-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #117645 - compiler-errors:auto-trait-subst, r=petroch…
…enkov Extend builtin/auto trait args with error when they have >1 argument Reuse `extend_with_error` to add error args to any auto trait (or built-in trait like `Copy` that is defined incorrectly) that has additional non-`Self` args. Fixes #117628
- Loading branch information
Showing
3 changed files
with
36 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#![feature(auto_traits)] | ||
|
||
auto trait Trait1<'outer> {} | ||
//~^ ERROR auto traits cannot have generic parameters | ||
|
||
fn f<'a>(x: impl Trait1<'a>) {} | ||
|
||
fn main() { | ||
f(""); | ||
} |
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,11 @@ | ||
error[E0567]: auto traits cannot have generic parameters | ||
--> $DIR/has-arguments.rs:3:18 | ||
| | ||
LL | auto trait Trait1<'outer> {} | ||
| ------^^^^^^^^ help: remove the parameters | ||
| | | ||
| auto trait cannot have generic parameters | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0567`. |