Skip to content

Commit bf766cd

Browse files
committed
Add test for #115019
1 parent fe5f591 commit bf766cd

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![allow(bare_trait_objects)]
2+
#![feature(associated_type_bounds)]
3+
trait Item {
4+
type Core;
5+
}
6+
pub struct Flatten<I> {
7+
inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core,
8+
//~^ ERROR E0191
9+
//~| ERROR E0223
10+
}
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
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
2+
--> $DIR/overlaping-bound-suggestion.rs:7:13
3+
|
4+
LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core,
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
| | |
7+
| | associated types `Item`, `IntoIter` must be specified
8+
| associated types `Item`, `IntoIter` must be specified
9+
|
10+
help: specify the associated types
11+
|
12+
LL | inner: <IntoIterator<Item: IntoIterator<Item: >, Item = Type, IntoIter = Type>IntoIterator<Item: , Item = Type, IntoIter = Type>>::IntoIterator as Item>::Core,
13+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
15+
error[E0223]: ambiguous associated type
16+
--> $DIR/overlaping-bound-suggestion.rs:7:13
17+
|
18+
LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core,
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
|
21+
help: if there were a trait named `Example` with associated type `IntoIterator` implemented for `(dyn IntoIterator + 'static)`, you could use the fully-qualified path
22+
|
23+
LL | inner: <<(dyn IntoIterator + 'static) as Example>::IntoIterator as Item>::Core,
24+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
26+
error: aborting due to 2 previous errors
27+
28+
Some errors have detailed explanations: E0191, E0223.
29+
For more information about an error, try `rustc --explain E0191`.

0 commit comments

Comments
 (0)