-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: negative polarity removes restrictions on validation of impl bl…
…ocks Negative polarity means we can just ignore if any trait items are not implemented. Fxies #3030 gcc/rust/ChangeLog: * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): the polarity was reversed * typecheck/rust-hir-type-check-item.cc: check the polarity gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3030.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
- Loading branch information
1 parent
5d703a3
commit 39eb3a4
Showing
4 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![feature(negative_impls)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
pub trait Deref {} | ||
|
||
pub trait DerefMut: Deref { | ||
type Target; | ||
|
||
/// Mutably dereferences the value. | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
fn deref_mut(&mut self) -> &mut Self::Target; | ||
} | ||
|
||
impl<T: ?Sized> !DerefMut for &T {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters