-
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 #106585 - estebank:issue-46585, r=compiler-errors
When suggesting writing a fully qualified path probe for appropriate types Address the more common part of #46585.
- Loading branch information
Showing
21 changed files
with
324 additions
and
55 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
14 changes: 14 additions & 0 deletions
14
tests/ui/associated-item/ambiguous-associated-type-with-generics.fixed
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,14 @@ | ||
// run-rustfix | ||
trait Trait<A> {} | ||
|
||
trait Assoc { | ||
type Ty; | ||
} | ||
|
||
impl<A> Assoc for dyn Trait<A> { | ||
type Ty = i32; | ||
} | ||
|
||
fn main() { | ||
let _x: <dyn Trait<i32> as Assoc>::Ty; //~ ERROR ambiguous associated type | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/ui/associated-item/ambiguous-associated-type-with-generics.rs
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,14 @@ | ||
// run-rustfix | ||
trait Trait<A> {} | ||
|
||
trait Assoc { | ||
type Ty; | ||
} | ||
|
||
impl<A> Assoc for dyn Trait<A> { | ||
type Ty = i32; | ||
} | ||
|
||
fn main() { | ||
let _x: <dyn Trait<i32>>::Ty; //~ ERROR ambiguous associated type | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/ui/associated-item/ambiguous-associated-type-with-generics.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,9 @@ | ||
error[E0223]: ambiguous associated type | ||
--> $DIR/ambiguous-associated-type-with-generics.rs:13:13 | ||
| | ||
LL | let _x: <dyn Trait<i32>>::Ty; | ||
| ^^^^^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<dyn Trait<i32> as Assoc>::Ty` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0223`. |
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
Oops, something went wrong.