rust/tests/ui/associated-types/associated-types-in-ambiguo...

56 lines
2.0 KiB
Plaintext

error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:8:36
|
LL | fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
| ^^^^^^^^^^
|
help: if there were a type named `Example` that implemented `Get`, you could use the fully-qualified path
|
LL | fn get<T:Get,U:Get>(x: T, y: U) -> <Example as Get>::Value {}
| ~~~~~~~~~~~~~~~~~~~~~~~
error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:13:23
|
LL | fn grab(&self) -> Grab::Value;
| ^^^^^^^^^^^ help: use fully-qualified syntax: `<Self as Grab>::Value`
error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:16:22
|
LL | fn get(&self) -> Get::Value;
| ^^^^^^^^^^
|
help: if there were a type named `Example` that implemented `Get`, you could use the fully-qualified path
|
LL | fn get(&self) -> <Example as Get>::Value;
| ~~~~~~~~~~~~~~~~~~~~~~~
error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:22:17
|
LL | trait Foo where Foo::Assoc: Bar {
| ^^^^^^^^^^ help: use fully-qualified syntax: `<Self as Foo>::Assoc`
error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:27:10
|
LL | type X = std::ops::Deref::Target;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: use fully-qualified syntax
|
LL | type X = <CString as Deref>::Target;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | type X = <IoSlice<'_> as Deref>::Target;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | type X = <IoSliceMut<'_> as Deref>::Target;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | type X = <OsString as Deref>::Target;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
and N other candidates
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0223`.