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#107100 - compiler-errors:issue-107087, r=lcnr
Use proper `InferCtxt` when probing for associated types in astconv Fixes rust-lang#107087
- Loading branch information
Showing
5 changed files
with
97 additions
and
46 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,18 @@ | ||
struct A<T>(T); | ||
|
||
trait Foo { | ||
type B; | ||
} | ||
|
||
impl Foo for A<u32> { | ||
type B = i32; | ||
} | ||
|
||
impl Foo for A<i32> { | ||
type B = i32; | ||
} | ||
|
||
fn main() { | ||
A::B::<>::C | ||
//~^ ERROR ambiguous associated type | ||
} |
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,9 @@ | ||
error[E0223]: ambiguous associated type | ||
--> $DIR/issue-107087.rs:16:5 | ||
| | ||
LL | A::B::<>::C | ||
| ^^^^^^^^ help: use the fully-qualified path: `<A<_> as Foo>::B` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0223`. |