-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): make gccrs recognize negative_impls * checks/errors/rust-feature-gate.h: likewise. * checks/errors/rust-feature.cc (Feature::create): likewise. * checks/errors/rust-feature.h: likewise. gcc/testsuite/ChangeLog: * rust/compile/negative_impls.rs: New test. * rust/compile/negative_impls_2.rs: New test.
- Loading branch information
1 parent
219cea7
commit 84666c6
Showing
6 changed files
with
39 additions
and
0 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
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,8 @@ | ||
#![feature(negative_impls)] | ||
|
||
trait ExampleTrait {} | ||
|
||
impl !ExampleTrait for i32 {} | ||
|
||
|
||
fn main() {} |
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 @@ | ||
// This test case should error out since we haven't included the negative_impls feature | ||
// Output from online rust compiler 2021 ver | ||
// Compiling playground v0.0.1 (/playground) | ||
// error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now | ||
// --> src/main.rs:8:6 | ||
// | | ||
// 8 | impl !ExampleTrait for i32 {}// | ||
// | ^^^^^^^^^^^^^ | ||
// | | ||
// = note: see issue #68318 <https://github.com/rust-lang/rust/issues/68318> for more information | ||
|
||
// For more information about this error, try `rustc --explain E0658`. | ||
// error: could not compile `playground` (bin "playground") due to 1 previous error | ||
trait ExampleTrait {} | ||
|
||
impl !ExampleTrait for i32 {} // { dg-error "negative_impls are not yet implemented" } |