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