提交 bf766cd3 编写于 作者: E Esteban Küber

Add test for #115019

上级 fe5f5912
#![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() {}
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
|
help: specify the associated types
|
LL | inner: <IntoIterator<Item: IntoIterator<Item: >, Item = Type, IntoIter = Type>IntoIterator<Item: , Item = Type, IntoIter = Type>>::IntoIterator as Item>::Core,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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`.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册