-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #102488 - compiler-errors:gat-compatibility, r=oli-obk
Check generic argument compatibility when projecting assoc ty Fixes #102114
- Loading branch information
Showing
3 changed files
with
68 additions
and
2 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,16 @@ | ||
trait A { | ||
type B<'b>; | ||
fn a() -> Self::B<'static>; | ||
} | ||
|
||
struct C; | ||
|
||
struct Wrapper<T>(T); | ||
|
||
impl A for C { | ||
type B<T> = Wrapper<T>; | ||
//~^ ERROR type `B` has 1 type parameter but its trait declaration has 0 type parameters | ||
fn a() -> Self::B<'static> {} | ||
} | ||
|
||
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,12 @@ | ||
error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters | ||
--> $DIR/issue-102114.rs:11:12 | ||
| | ||
LL | type B<'b>; | ||
| -- expected 0 type parameters | ||
... | ||
LL | type B<T> = Wrapper<T>; | ||
| ^ found 1 type parameter | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0049`. |