summaryrefslogtreecommitdiffstats
path: root/tests/ui/dst/dst-bad-coerce1.stderr
blob: 455d15e935faeb2b0bad88f71d8fd837ec5836c8 (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
error[E0308]: mismatched types
  --> $DIR/dst-bad-coerce1.rs:16:29
   |
LL |     let f3: &Fat<[usize]> = f2;
   |             -------------   ^^ expected `&Fat<[usize]>`, found `&Fat<[isize; 3]>`
   |             |
   |             expected due to this
   |
   = note: expected reference `&Fat<[usize]>`
              found reference `&Fat<[isize; 3]>`

error[E0277]: the trait bound `Foo: Bar` is not satisfied
  --> $DIR/dst-bad-coerce1.rs:22:29
   |
LL |     let f3: &Fat<dyn Bar> = f2;
   |                             ^^ the trait `Bar` is not implemented for `Foo`
   |
help: this trait has no implementations, consider adding one
  --> $DIR/dst-bad-coerce1.rs:10:1
   |
LL | trait Bar { fn bar(&self) {} }
   | ^^^^^^^^^
   = note: required for the cast from `&Fat<Foo>` to `&Fat<dyn Bar>`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coerce1.rs:28:27
   |
LL |     let f3: &([usize],) = f2;
   |             -----------   ^^ expected `&([usize],)`, found `&([isize; 3],)`
   |             |
   |             expected due to this
   |
   = note: expected reference `&([usize],)`
              found reference `&([isize; 3],)`

error[E0277]: the trait bound `Foo: Bar` is not satisfied
  --> $DIR/dst-bad-coerce1.rs:34:27
   |
LL |     let f3: &(dyn Bar,) = f2;
   |                           ^^ the trait `Bar` is not implemented for `Foo`
   |
help: this trait has no implementations, consider adding one
  --> $DIR/dst-bad-coerce1.rs:10:1
   |
LL | trait Bar { fn bar(&self) {} }
   | ^^^^^^^^^
   = note: required for the cast from `&(Foo,)` to `&(dyn Bar,)`

error: aborting due to 4 previous errors

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