1 error[E0033]: type `&dyn T` cannot be dereferenced
2 --> $DIR/destructure-trait-ref.rs:26:9
4 LL | let &x = &1isize as &dyn T;
5 | ^^ type `&dyn T` cannot be dereferenced
7 error[E0033]: type `&dyn T` cannot be dereferenced
8 --> $DIR/destructure-trait-ref.rs:27:10
10 LL | let &&x = &(&1isize as &dyn T);
11 | ^^ type `&dyn T` cannot be dereferenced
13 error[E0033]: type `std::boxed::Box<dyn T>` cannot be dereferenced
14 --> $DIR/destructure-trait-ref.rs:28:9
16 LL | let box x = box 1isize as Box<dyn T>;
17 | ^^^^^ type `std::boxed::Box<dyn T>` cannot be dereferenced
19 error[E0308]: mismatched types
20 --> $DIR/destructure-trait-ref.rs:32:10
22 LL | let &&x = &1isize as &dyn T;
25 | expected trait `T`, found reference
26 | help: you can probably remove the explicit borrow: `x`
28 = note: expected trait object `dyn T`
31 error[E0308]: mismatched types
32 --> $DIR/destructure-trait-ref.rs:37:11
34 LL | let &&&x = &(&1isize as &dyn T);
37 | expected trait `T`, found reference
38 | help: you can probably remove the explicit borrow: `x`
40 = note: expected trait object `dyn T`
43 error[E0308]: mismatched types
44 --> $DIR/destructure-trait-ref.rs:42:13
46 LL | let box box x = box 1isize as Box<dyn T>;
47 | ^^^^^ expected trait `T`, found struct `std::boxed::Box`
49 = note: expected trait object `dyn T`
50 found struct `std::boxed::Box<_>`
52 error: aborting due to 6 previous errors
54 Some errors have detailed explanations: E0033, E0308.
55 For more information about an error, try `rustc --explain E0033`.