forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#105230 - cjgillot:issue-104312, r=petrochenkov
Skip recording resolution for duplicated generic params. Turns out the fix was simpler than I thought. Fixes rust-lang#104312
- Loading branch information
Showing
4 changed files
with
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
trait Foo<const M: u8, const M: u8 = M> {} | ||
//~^ ERROR the name `M` is already used for a generic parameter in this item's generic parameters | ||
impl Foo<2> for () {} | ||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/const-generics/defaults/self-referential.stderr
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[E0403]: the name `M` is already used for a generic parameter in this item's generic parameters | ||
--> $DIR/self-referential.rs:1:30 | ||
| | ||
LL | trait Foo<const M: u8, const M: u8 = M> {} | ||
| - ^ already used | ||
| | | ||
| first use of `M` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0403`. |
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