fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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