forked from Rust-GCC/gccrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw an error when auto-traits used without feature attribute. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Emit error on trait when auto field member true. * checks/errors/rust-feature-gate.h: add prototype of trait visitor. * checks/errors/rust-feature.cc (Feature::create): add optin_builtin_traits in match of feature. gcc/testsuite/ChangeLog: * rust/compile/auto_trait_super_trait.rs: Add feature attribute. * rust/compile/generic_auto_trait.rs: likewise. * rust/compile/auto_trait.rs: add test for error without feature attribute Signed-off-by: benjamin.thos <[email protected]>
- Loading branch information
1 parent
9941d6f
commit f2e0322
Showing
6 changed files
with
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
auto trait Valid {} // { dg-error "auto traits are experimental and possibly buggy" } |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![feature(optin_builtin_traits)] | ||
trait Cold {} | ||
|
||
auto trait IsCool: Cold {} | ||
|
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#![feature(optin_builtin_traits)] | ||
auto trait IsCooler<G> {} | ||
// { dg-error "auto traits cannot have generic parameters .E0567." "" { target *-*-* } .-1 } |