-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check generic argument compatibility when projecting assoc ty
- Loading branch information
1 parent
594134d
commit ee713f3
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`. |