forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#115077 - estebank:issue-115019, r=compiler-…
…errors Do not emit invalid suggestion in E0191 when spans overlap Fix rust-lang#115019.
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
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
12 changes: 12 additions & 0 deletions
12
tests/ui/associated-type-bounds/overlaping-bound-suggestion.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,12 @@ | ||
#![allow(bare_trait_objects)] | ||
#![feature(associated_type_bounds)] | ||
trait Item { | ||
type Core; | ||
} | ||
pub struct Flatten<I> { | ||
inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, | ||
//~^ ERROR E0191 | ||
//~| ERROR E0223 | ||
} | ||
|
||
fn main() {} |
24 changes: 24 additions & 0 deletions
24
tests/ui/associated-type-bounds/overlaping-bound-suggestion.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,24 @@ | ||
error[E0191]: the value of the associated types `IntoIter` (from trait `IntoIterator`), `IntoIter` (from trait `IntoIterator`), `Item` (from trait `IntoIterator`), `Item` (from trait `IntoIterator`) must be specified | ||
--> $DIR/overlaping-bound-suggestion.rs:7:13 | ||
| | ||
LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | | ||
| | associated types `Item`, `IntoIter` must be specified | ||
| associated types `Item`, `IntoIter` must be specified | ||
|
||
error[E0223]: ambiguous associated type | ||
--> $DIR/overlaping-bound-suggestion.rs:7:13 | ||
| | ||
LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
help: if there were a trait named `Example` with associated type `IntoIterator` implemented for `(dyn IntoIterator + 'static)`, you could use the fully-qualified path | ||
| | ||
LL | inner: <<(dyn IntoIterator + 'static) as Example>::IntoIterator as Item>::Core, | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0191, E0223. | ||
For more information about an error, try `rustc --explain E0191`. |