1
Fork 0
rust/src/test/ui/destructure-trait-ref.stderr

56 lines
1.7 KiB
Text
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0033]: type `&dyn T` cannot be dereferenced
2018-12-25 08:56:47 -07:00
--> $DIR/destructure-trait-ref.rs:26:9
2018-08-08 14:28:26 +02:00
|
2019-05-28 14:46:13 -04:00
LL | let &x = &1isize as &dyn T;
2018-08-08 14:28:26 +02:00
| ^^ type `&dyn T` cannot be dereferenced
error[E0033]: type `&dyn T` cannot be dereferenced
2018-12-25 08:56:47 -07:00
--> $DIR/destructure-trait-ref.rs:27:10
2018-08-08 14:28:26 +02:00
|
2019-05-28 14:46:13 -04:00
LL | let &&x = &(&1isize as &dyn T);
2018-08-08 14:28:26 +02:00
| ^^ type `&dyn T` cannot be dereferenced
error[E0033]: type `std::boxed::Box<dyn T>` cannot be dereferenced
2018-12-25 08:56:47 -07:00
--> $DIR/destructure-trait-ref.rs:28:9
2018-08-08 14:28:26 +02:00
|
2019-05-28 14:46:13 -04:00
LL | let box x = box 1isize as Box<dyn T>;
2018-08-08 14:28:26 +02:00
| ^^^^^ type `std::boxed::Box<dyn T>` cannot be dereferenced
error[E0308]: mismatched types
2019-05-28 14:46:13 -04:00
--> $DIR/destructure-trait-ref.rs:32:10
2018-08-08 14:28:26 +02:00
|
2019-05-28 14:46:13 -04:00
LL | let &&x = &1isize as &dyn T;
| ^^
| |
| expected trait T, found reference
2019-04-29 19:56:50 -07:00
| help: you can probably remove the explicit borrow: `x`
2018-08-08 14:28:26 +02:00
|
= note: expected trait `dyn T`
found reference `&_`
2018-08-08 14:28:26 +02:00
error[E0308]: mismatched types
2019-05-28 14:46:13 -04:00
--> $DIR/destructure-trait-ref.rs:37:11
2018-08-08 14:28:26 +02:00
|
2019-05-28 14:46:13 -04:00
LL | let &&&x = &(&1isize as &dyn T);
| ^^
| |
| expected trait T, found reference
2019-04-29 19:56:50 -07:00
| help: you can probably remove the explicit borrow: `x`
2018-08-08 14:28:26 +02:00
|
= note: expected trait `dyn T`
found reference `&_`
2018-08-08 14:28:26 +02:00
error[E0308]: mismatched types
2019-05-28 14:46:13 -04:00
--> $DIR/destructure-trait-ref.rs:42:13
2018-08-08 14:28:26 +02:00
|
2019-05-28 14:46:13 -04:00
LL | let box box x = box 1isize as Box<dyn T>;
2018-08-08 14:28:26 +02:00
| ^^^^^ expected trait T, found struct `std::boxed::Box`
|
= note: expected trait `dyn T`
found struct `std::boxed::Box<_>`
2018-08-08 14:28:26 +02:00
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0033, E0308.
2018-08-08 14:28:26 +02:00
For more information about an error, try `rustc --explain E0033`.