2018-08-08 12:28:26 +00:00
|
|
|
error[E0033]: type `&dyn T` cannot be dereferenced
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/destructure-trait-ref.rs:26:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | let &x = &1isize as &dyn T;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^ type `&dyn T` cannot be dereferenced
|
|
|
|
|
|
|
|
error[E0033]: type `&dyn T` cannot be dereferenced
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/destructure-trait-ref.rs:27:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | let &&x = &(&1isize as &dyn T);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^ type `&dyn T` cannot be dereferenced
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
error[E0033]: type `Box<dyn T>` cannot be dereferenced
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/destructure-trait-ref.rs:28:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
LL | let box x = Box::new(1isize) as Box<dyn T>;
|
2020-09-02 07:40:56 +00:00
|
|
|
| ^^^^^ type `Box<dyn T>` cannot be dereferenced
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-05-28 18:46:13 +00:00
|
|
|
--> $DIR/destructure-trait-ref.rs:32:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | let &&x = &1isize as &dyn T;
|
2020-02-25 04:53:21 +00:00
|
|
|
| ^^ ----------------- this expression has type `&dyn T`
|
2019-04-30 02:02:54 +00:00
|
|
|
| |
|
2023-01-03 02:00:33 +00:00
|
|
|
| expected `dyn T`, found `&_`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-11-14 22:08:08 +00:00
|
|
|
= note: expected trait object `dyn T`
|
|
|
|
found reference `&_`
|
2022-06-10 19:18:42 +00:00
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL - let &&x = &1isize as &dyn T;
|
|
|
|
LL + let &x = &1isize as &dyn T;
|
2022-06-15 11:15:54 +00:00
|
|
|
|
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2020-01-14 21:18:06 +00:00
|
|
|
--> $DIR/destructure-trait-ref.rs:36:11
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | let &&&x = &(&1isize as &dyn T);
|
2020-02-25 04:53:21 +00:00
|
|
|
| ^^ -------------------- this expression has type `&&dyn T`
|
2019-04-30 02:02:54 +00:00
|
|
|
| |
|
2023-01-03 02:00:33 +00:00
|
|
|
| expected `dyn T`, found `&_`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-11-14 22:08:08 +00:00
|
|
|
= note: expected trait object `dyn T`
|
|
|
|
found reference `&_`
|
2022-06-10 19:18:42 +00:00
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL - let &&&x = &(&1isize as &dyn T);
|
|
|
|
LL + let &&x = &(&1isize as &dyn T);
|
2022-06-15 11:15:54 +00:00
|
|
|
|
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2020-01-14 21:18:06 +00:00
|
|
|
--> $DIR/destructure-trait-ref.rs:40:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2021-08-25 00:39:40 +00:00
|
|
|
LL | let box box x = Box::new(1isize) as Box<dyn T>;
|
|
|
|
| ^^^^^ ------------------------------ this expression has type `Box<dyn T>`
|
2019-12-30 08:08:18 +00:00
|
|
|
| |
|
2023-01-03 02:00:33 +00:00
|
|
|
| expected `dyn T`, found `Box<_>`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-11-14 22:08:08 +00:00
|
|
|
= note: expected trait object `dyn T`
|
2020-09-02 07:40:56 +00:00
|
|
|
found struct `Box<_>`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0033, E0308.
|
2018-08-08 12:28:26 +00:00
|
|
|
For more information about an error, try `rustc --explain E0033`.
|