fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.7 KiB52 linesraw
1error[E0308]: mismatched types
2  --> $DIR/dst-bad-coerce1.rs:16:29
3   |
4LL |     let f3: &Fat<[usize]> = f2;
5   |             -------------   ^^ expected `&Fat<[usize]>`, found `&Fat<[isize; 3]>`
6   |             |
7   |             expected due to this
8   |
9   = note: expected reference `&Fat<[usize]>`
10              found reference `&Fat<[isize; 3]>`
11
12error[E0277]: the trait bound `Foo: Bar` is not satisfied
13  --> $DIR/dst-bad-coerce1.rs:22:29
14   |
15LL |     let f3: &Fat<dyn Bar> = f2;
16   |                             ^^ the trait `Bar` is not implemented for `Foo`
17   |
18help: this trait has no implementations, consider adding one
19  --> $DIR/dst-bad-coerce1.rs:10:1
20   |
21LL | trait Bar { fn bar(&self) {} }
22   | ^^^^^^^^^
23   = note: required for the cast from `&Fat<Foo>` to `&Fat<dyn Bar>`
24
25error[E0308]: mismatched types
26  --> $DIR/dst-bad-coerce1.rs:28:27
27   |
28LL |     let f3: &([usize],) = f2;
29   |             -----------   ^^ expected `&([usize],)`, found `&([isize; 3],)`
30   |             |
31   |             expected due to this
32   |
33   = note: expected reference `&([usize],)`
34              found reference `&([isize; 3],)`
35
36error[E0277]: the trait bound `Foo: Bar` is not satisfied
37  --> $DIR/dst-bad-coerce1.rs:34:27
38   |
39LL |     let f3: &(dyn Bar,) = f2;
40   |                           ^^ the trait `Bar` is not implemented for `Foo`
41   |
42help: this trait has no implementations, consider adding one
43  --> $DIR/dst-bad-coerce1.rs:10:1
44   |
45LL | trait Bar { fn bar(&self) {} }
46   | ^^^^^^^^^
47   = note: required for the cast from `&(Foo,)` to `&(dyn Bar,)`
48
49error: aborting due to 4 previous errors
50
51Some errors have detailed explanations: E0277, E0308.
52For more information about an error, try `rustc --explain E0277`.