1 error[E0033]: type `&dyn T` cannot be dereferenced
2 --> $DIR/destructure-trait-ref.rs:36:9
4 LL | let &x = &1isize as &T; //~ ERROR type `&dyn T` cannot be dereferenced
5 | ^^ type `&dyn T` cannot be dereferenced
7 error[E0033]: type `&dyn T` cannot be dereferenced
8 --> $DIR/destructure-trait-ref.rs:37:10
10 LL | let &&x = &(&1isize as &T); //~ ERROR type `&dyn T` cannot be dereferenced
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:38:9
16 LL | let box x = box 1isize as Box<T>; //~ ERROR type `std::boxed::Box<dyn T>` cannot be dereferenced
17 | ^^^^^ type `std::boxed::Box<dyn T>` cannot be dereferenced
19 error[E0308]: mismatched types
20 --> $DIR/destructure-trait-ref.rs:41:10
22 LL | let &&x = &1isize as &T;
23 | ^^ expected trait T, found reference
25 = note: expected type `dyn T`
27 = help: did you mean `x: &dyn T`?
29 error[E0308]: mismatched types
30 --> $DIR/destructure-trait-ref.rs:46:11
32 LL | let &&&x = &(&1isize as &T);
33 | ^^ expected trait T, found reference
35 = note: expected type `dyn T`
37 = help: did you mean `x: &dyn T`?
39 error[E0308]: mismatched types
40 --> $DIR/destructure-trait-ref.rs:51:13
42 LL | let box box x = box 1isize as Box<T>;
43 | ^^^^^ expected trait T, found struct `std::boxed::Box`
45 = note: expected type `dyn T`
46 found type `std::boxed::Box<_>`
48 error: aborting due to 6 previous errors
50 Some errors occurred: E0033, E0308.
51 For more information about an error, try `rustc --explain E0033`.