about summary refs log tree commit diff
path: root/tests/ui/traits/trait-object-destructure.stderr
blob: c7c832dc40affae58284467c5c5762ed6ed13234 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
error[E0033]: type `&dyn T` cannot be dereferenced
  --> $DIR/trait-object-destructure.rs:21:9
   |
LL |     let &x = &1isize as &dyn T;
   |         ^^ type `&dyn T` cannot be dereferenced

error[E0033]: type `&dyn T` cannot be dereferenced
  --> $DIR/trait-object-destructure.rs:22:10
   |
LL |     let &&x = &(&1isize as &dyn T);
   |          ^^ type `&dyn T` cannot be dereferenced

error[E0033]: type `Box<dyn T>` cannot be dereferenced
  --> $DIR/trait-object-destructure.rs:23:9
   |
LL |     let box x = Box::new(1isize) as Box<dyn T>;
   |         ^^^^^ type `Box<dyn T>` cannot be dereferenced

error[E0308]: mismatched types
  --> $DIR/trait-object-destructure.rs:26:10
   |
LL |     let &&x = &1isize as &dyn T;
   |          ^^   ----------------- this expression has type `&dyn T`
   |          |
   |          expected `dyn T`, found `&_`
   |
   = note: expected trait object `dyn T`
                 found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     let &&x = &1isize as &dyn T;
LL +     let &x = &1isize as &dyn T;
   |

error[E0308]: mismatched types
  --> $DIR/trait-object-destructure.rs:27:11
   |
LL |     let &&&x = &(&1isize as &dyn T);
   |           ^^   -------------------- this expression has type `&&dyn T`
   |           |
   |           expected `dyn T`, found `&_`
   |
   = note: expected trait object `dyn T`
                 found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     let &&&x = &(&1isize as &dyn T);
LL +     let &&x = &(&1isize as &dyn T);
   |

error[E0308]: mismatched types
  --> $DIR/trait-object-destructure.rs:28:13
   |
LL |     let box box x = Box::new(1isize) as Box<dyn T>;
   |             ^^^^^   ------------------------------ this expression has type `Box<dyn T>`
   |             |
   |             expected `dyn T`, found `Box<_>`
   |
   = note: expected trait object `dyn T`
                    found struct `Box<_>`

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0033, E0308.
For more information about an error, try `rustc --explain E0033`.