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