]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-bad-coercions.stderr
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
[rust.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    = note: expected type `&S`
8               found type `*const S`
9
10 error[E0308]: mismatched types
11   --> $DIR/dst-bad-coercions.rs:15:21
12    |
13 LL |     let y: &dyn T = x;
14    |                     ^
15    |                     |
16    |                     expected &dyn T, found *-ptr
17    |                     help: consider borrowing here: `&x`
18    |
19    = note: expected type `&dyn T`
20               found type `*const S`
21
22 error[E0308]: mismatched types
23   --> $DIR/dst-bad-coercions.rs:19:17
24    |
25 LL |     let y: &S = x;
26    |                 ^ expected &S, found *-ptr
27    |
28    = note: expected type `&S`
29               found type `*mut S`
30
31 error[E0308]: mismatched types
32   --> $DIR/dst-bad-coercions.rs:20:21
33    |
34 LL |     let y: &dyn T = x;
35    |                     ^
36    |                     |
37    |                     expected &dyn T, found *-ptr
38    |                     help: consider borrowing here: `&x`
39    |
40    = note: expected type `&dyn T`
41               found type `*mut S`
42
43 error[E0308]: mismatched types
44   --> $DIR/dst-bad-coercions.rs:23:25
45    |
46 LL |     let x: &mut dyn T = &S;
47    |                         ^^ types differ in mutability
48    |
49    = note: expected type `&mut dyn T`
50               found type `&S`
51
52 error[E0308]: mismatched types
53   --> $DIR/dst-bad-coercions.rs:24:25
54    |
55 LL |     let x: *mut dyn T = &S;
56    |                         ^^ types differ in mutability
57    |
58    = note: expected type `*mut dyn T`
59               found type `&S`
60
61 error[E0308]: mismatched types
62   --> $DIR/dst-bad-coercions.rs:25:21
63    |
64 LL |     let x: *mut S = &S;
65    |                     ^^ types differ in mutability
66    |
67    = note: expected type `*mut S`
68               found type `&S`
69
70 error: aborting due to 7 previous errors
71
72 For more information about this error, try `rustc --explain E0308`.