2023-10-16 01:22:25 +00:00
|
|
|
error[E0221]: ambiguous associated type `Type` in bounds of `T`
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:23:12
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | type Type;
|
|
|
|
| --------- ambiguous `Type` from `A`
|
|
|
|
...
|
|
|
|
LL | type Type;
|
|
|
|
| --------- ambiguous `Type` from `B`
|
|
|
|
...
|
|
|
|
LL | let _: T::Type;
|
|
|
|
| ^^^^^^^ ambiguous associated type `Type`
|
|
|
|
|
|
2023-10-16 18:25:11 +00:00
|
|
|
help: use fully-qualified syntax to disambiguate
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | let _: <T as A>::Type;
|
|
|
|
| ~~~~~~~~~~
|
2023-10-16 18:25:11 +00:00
|
|
|
help: use fully-qualified syntax to disambiguate
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | let _: <T as B>::Type;
|
|
|
|
| ~~~~~~~~~~
|
|
|
|
|
|
|
|
error[E0034]: multiple applicable items in scope
|
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:16:7
|
|
|
|
|
|
|
|
|
LL | t.foo();
|
|
|
|
| ^^^ multiple `foo` found
|
|
|
|
|
|
|
|
|
note: candidate #1 is defined in the trait `A`
|
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:4:5
|
|
|
|
|
|
|
|
|
LL | fn foo(&self);
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
note: candidate #2 is defined in the trait `B`
|
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:10:5
|
|
|
|
|
|
|
|
|
LL | fn foo(&self);
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
help: disambiguate the method for candidate #1
|
|
|
|
|
|
2023-11-07 05:22:20 +00:00
|
|
|
LL | A::foo(&t);
|
|
|
|
| ~~~~~~~~~~
|
2023-10-16 01:22:25 +00:00
|
|
|
help: disambiguate the method for candidate #2
|
|
|
|
|
|
2023-11-07 05:22:20 +00:00
|
|
|
LL | B::foo(&t);
|
|
|
|
| ~~~~~~~~~~
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
error[E0034]: multiple applicable items in scope
|
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:20:16
|
|
|
|
|
|
|
|
|
LL | let _ = T::CONST;
|
|
|
|
| ^^^^^ multiple `CONST` found
|
|
|
|
|
|
|
|
|
note: candidate #1 is defined in the trait `A`
|
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:3:5
|
|
|
|
|
|
|
|
|
LL | const CONST: usize = 1;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
note: candidate #2 is defined in the trait `B`
|
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:9:5
|
|
|
|
|
|
|
|
|
LL | const CONST: usize;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2023-10-16 18:25:11 +00:00
|
|
|
help: use fully-qualified syntax to disambiguate
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
2023-11-07 05:22:20 +00:00
|
|
|
LL | let _ = <T as A>::CONST;
|
|
|
|
| ~~~~~~~~~~
|
|
|
|
LL | let _ = <T as B>::CONST;
|
|
|
|
| ~~~~~~~~~~
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
error[E0223]: ambiguous associated type
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:52:12
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | let _: S::Type;
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
2023-10-16 18:25:11 +00:00
|
|
|
help: use fully-qualified syntax
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | let _: <S as A>::Type;
|
|
|
|
| ~~~~~~~~~~~~~~
|
|
|
|
LL | let _: <S as B>::Type;
|
|
|
|
| ~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
error[E0034]: multiple applicable items in scope
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:46:8
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | S::foo(&s);
|
|
|
|
| ^^^ multiple `foo` found
|
|
|
|
|
|
|
|
|
note: candidate #1 is defined in an impl of the trait `A` for the type `T`
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:35:5
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | fn foo(&self) {}
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
note: candidate #2 is defined in an impl of the trait `B` for the type `T`
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:41:5
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | fn foo(&self) {}
|
|
|
|
| ^^^^^^^^^^^^^
|
2023-10-16 18:25:11 +00:00
|
|
|
help: use fully-qualified syntax to disambiguate
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
2023-11-07 05:22:20 +00:00
|
|
|
LL | A::foo(&s);
|
|
|
|
| ~~~
|
|
|
|
LL | B::foo(&s);
|
|
|
|
| ~~~
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
error[E0034]: multiple applicable items in scope
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:49:16
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | let _ = S::CONST;
|
|
|
|
| ^^^^^ multiple `CONST` found
|
|
|
|
|
|
|
|
|
note: candidate #1 is defined in an impl of the trait `A` for the type `T`
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:34:5
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | const CONST: usize = 1;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
note: candidate #2 is defined in an impl of the trait `B` for the type `T`
|
2023-10-16 18:25:11 +00:00
|
|
|
--> $DIR/disambiguate-multiple-trait-2.rs:40:5
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
|
|
|
LL | const CONST: usize = 1;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2023-10-16 18:25:11 +00:00
|
|
|
help: use fully-qualified syntax to disambiguate
|
2023-10-16 01:22:25 +00:00
|
|
|
|
|
2023-11-07 05:22:20 +00:00
|
|
|
LL | let _ = <S as A>::CONST;
|
2023-10-16 01:22:25 +00:00
|
|
|
| ~~~~~~~~~~
|
2023-11-07 05:22:20 +00:00
|
|
|
LL | let _ = <S as B>::CONST;
|
2023-10-16 01:22:25 +00:00
|
|
|
| ~~~~~~~~~~
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0034, E0221, E0223.
|
|
|
|
For more information about an error, try `rustc --explain E0034`.
|