]> git.proxmox.com Git - rustc.git/blob - src/test/ui/dst/dst-bad-coercions.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / dst / dst-bad-coercions.stderr
1 error[E0308]: mismatched types
2 --> $DIR/dst-bad-coercions.rs:14:17
3 |
4 LL | let y: &S = x;
5 | -- ^ expected `&S`, found *-ptr
6 | |
7 | expected due to this
8 |
9 = note: expected reference `&S`
10 found raw pointer `*const S`
11
12 error[E0308]: mismatched types
13 --> $DIR/dst-bad-coercions.rs:15:21
14 |
15 LL | let y: &dyn T = x;
16 | ------ ^
17 | | |
18 | | expected `&dyn T`, found *-ptr
19 | | help: consider borrowing here: `&x`
20 | expected due to this
21 |
22 = note: expected reference `&dyn T`
23 found raw pointer `*const S`
24
25 error[E0308]: mismatched types
26 --> $DIR/dst-bad-coercions.rs:19:17
27 |
28 LL | let y: &S = x;
29 | -- ^ expected `&S`, found *-ptr
30 | |
31 | expected due to this
32 |
33 = note: expected reference `&S`
34 found raw pointer `*mut S`
35
36 error[E0308]: mismatched types
37 --> $DIR/dst-bad-coercions.rs:20:21
38 |
39 LL | let y: &dyn T = x;
40 | ------ ^
41 | | |
42 | | expected `&dyn T`, found *-ptr
43 | | help: consider borrowing here: `&x`
44 | expected due to this
45 |
46 = note: expected reference `&dyn T`
47 found raw pointer `*mut S`
48
49 error[E0308]: mismatched types
50 --> $DIR/dst-bad-coercions.rs:23:25
51 |
52 LL | let x: &mut dyn T = &S;
53 | ---------- ^^ types differ in mutability
54 | |
55 | expected due to this
56 |
57 = note: expected mutable reference `&mut dyn T`
58 found reference `&S`
59
60 error[E0308]: mismatched types
61 --> $DIR/dst-bad-coercions.rs:24:25
62 |
63 LL | let x: *mut dyn T = &S;
64 | ---------- ^^ types differ in mutability
65 | |
66 | expected due to this
67 |
68 = note: expected raw pointer `*mut dyn T`
69 found reference `&S`
70
71 error[E0308]: mismatched types
72 --> $DIR/dst-bad-coercions.rs:25:21
73 |
74 LL | let x: *mut S = &S;
75 | ------ ^^ types differ in mutability
76 | |
77 | expected due to this
78 |
79 = note: expected raw pointer `*mut S`
80 found reference `&S`
81
82 error: aborting due to 7 previous errors
83
84 For more information about this error, try `rustc --explain E0308`.