blob: 09a8c8f8a88a205e2828f43dad1a86ee527740ec [file] [log] [blame]
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/defaults-specialization.rs:3:38
|
LL | #![feature(associated_type_defaults, specialization)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
error[E0053]: method `make` has an incompatible type for trait
--> $DIR/defaults-specialization.rs:19:18
|
LL | fn make() -> Self::Ty {
| -------- type in trait
...
LL | fn make() -> u8 { 0 }
| ^^ expected associated type, found `u8`
|
= note: expected fn pointer `fn() -> <A<T> as Tr>::Ty`
found fn pointer `fn() -> u8`
error[E0053]: method `make` has an incompatible type for trait
--> $DIR/defaults-specialization.rs:35:18
|
LL | fn make() -> Self::Ty {
| -------- type in trait
...
LL | default type Ty = bool;
| ----------------------- expected this associated type
LL |
LL | fn make() -> bool { true }
| ^^^^ expected associated type, found `bool`
|
= note: expected fn pointer `fn() -> <B<T> as Tr>::Ty`
found fn pointer `fn() -> bool`
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:10:9
|
LL | type Ty = u8;
| ------------- associated type defaults can't be assumed inside the trait defining them
LL |
LL | fn make() -> Self::Ty {
| -------- expected `<Self as Tr>::Ty` because of return type
LL | 0u8
| ^^^ expected associated type, found `u8`
|
= note: expected associated type `<Self as Tr>::Ty`
found type `u8`
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:26:29
|
LL | fn make() -> Self::Ty { 0u8 }
| -------- ^^^ expected associated type, found `u8`
| |
| expected `<A2<T> as Tr>::Ty` because of return type
|
= note: expected associated type `<A2<T> as Tr>::Ty`
found type `u8`
= help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:44:29
|
LL | default type Ty = bool;
| ----------------------- expected this associated type
LL |
LL | fn make() -> Self::Ty { true }
| -------- ^^^^ expected associated type, found `bool`
| |
| expected `<B2<T> as Tr>::Ty` because of return type
|
= note: expected associated type `<B2<T> as Tr>::Ty`
found type `bool`
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:87:32
|
LL | let _: <B<()> as Tr>::Ty = 0u8;
| ----------------- ^^^ expected associated type, found `u8`
| |
| expected due to this
|
= note: expected associated type `<B<()> as Tr>::Ty`
found type `u8`
help: a method is available that returns `<B<()> as Tr>::Ty`
--> $DIR/defaults-specialization.rs:9:5
|
LL | fn make() -> Self::Ty {
| ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:88:32
|
LL | let _: <B<()> as Tr>::Ty = true;
| ----------------- ^^^^ expected associated type, found `bool`
| |
| expected due to this
|
= note: expected associated type `<B<()> as Tr>::Ty`
found type `bool`
help: a method is available that returns `<B<()> as Tr>::Ty`
--> $DIR/defaults-specialization.rs:9:5
|
LL | fn make() -> Self::Ty {
| ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:89:33
|
LL | let _: <B2<()> as Tr>::Ty = 0u8;
| ------------------ ^^^ expected associated type, found `u8`
| |
| expected due to this
|
= note: expected associated type `<B2<()> as Tr>::Ty`
found type `u8`
help: a method is available that returns `<B2<()> as Tr>::Ty`
--> $DIR/defaults-specialization.rs:9:5
|
LL | fn make() -> Self::Ty {
| ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
error[E0308]: mismatched types
--> $DIR/defaults-specialization.rs:90:33
|
LL | let _: <B2<()> as Tr>::Ty = true;
| ------------------ ^^^^ expected associated type, found `bool`
| |
| expected due to this
|
= note: expected associated type `<B2<()> as Tr>::Ty`
found type `bool`
help: a method is available that returns `<B2<()> as Tr>::Ty`
--> $DIR/defaults-specialization.rs:9:5
|
LL | fn make() -> Self::Ty {
| ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
error: aborting due to 9 previous errors; 1 warning emitted
Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.