blob: d3ad21eb24ffb39e5c6251e3dbfd2cabe689ea66 [file] [log] [blame]
error[E0033]: type `&dyn T` cannot be dereferenced
--> $DIR/destructure-trait-ref.rs:26:9
|
LL | let &x = &1isize as &dyn T;
| ^^ type `&dyn T` cannot be dereferenced
error[E0033]: type `&dyn T` cannot be dereferenced
--> $DIR/destructure-trait-ref.rs:27:10
|
LL | let &&x = &(&1isize as &dyn T);
| ^^ type `&dyn T` cannot be dereferenced
error[E0033]: type `std::boxed::Box<dyn T>` cannot be dereferenced
--> $DIR/destructure-trait-ref.rs:28:9
|
LL | let box x = box 1isize as Box<dyn T>;
| ^^^^^ type `std::boxed::Box<dyn T>` cannot be dereferenced
error[E0308]: mismatched types
--> $DIR/destructure-trait-ref.rs:32:10
|
LL | let &&x = &1isize as &dyn T;
| ^^
| |
| expected trait T, found reference
| help: you can probably remove the explicit borrow: `x`
|
= note: expected type `dyn T`
found type `&_`
error[E0308]: mismatched types
--> $DIR/destructure-trait-ref.rs:37:11
|
LL | let &&&x = &(&1isize as &dyn T);
| ^^
| |
| expected trait T, found reference
| help: you can probably remove the explicit borrow: `x`
|
= note: expected type `dyn T`
found type `&_`
error[E0308]: mismatched types
--> $DIR/destructure-trait-ref.rs:42:13
|
LL | let box box x = box 1isize as Box<dyn T>;
| ^^^^^ expected trait T, found struct `std::boxed::Box`
|
= note: expected type `dyn T`
found type `std::boxed::Box<_>`
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0033, E0308.
For more information about an error, try `rustc --explain E0033`.