summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dst/dst-bad-coercions.stderr
blob: 01f862ed516e9d9ef25735436c67c6e8891cc65b (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:14:17
   |
LL |     let y: &S = x;
   |            --   ^ expected `&S`, found *-ptr
   |            |
   |            expected due to this
   |
   = note: expected reference `&S`
            found raw pointer `*const S`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:15:21
   |
LL |     let y: &dyn T = x;
   |            ------   ^ expected `&dyn T`, found *-ptr
   |            |
   |            expected due to this
   |
   = note: expected reference `&dyn T`
            found raw pointer `*const S`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:19:17
   |
LL |     let y: &S = x;
   |            --   ^ expected `&S`, found *-ptr
   |            |
   |            expected due to this
   |
   = note: expected reference `&S`
            found raw pointer `*mut S`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:20:21
   |
LL |     let y: &dyn T = x;
   |            ------   ^ expected `&dyn T`, found *-ptr
   |            |
   |            expected due to this
   |
   = note: expected reference `&dyn T`
            found raw pointer `*mut S`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:23:25
   |
LL |     let x: &mut dyn T = &S;
   |            ----------   ^^ types differ in mutability
   |            |
   |            expected due to this
   |
   = note: expected mutable reference `&mut dyn T`
                      found reference `&S`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:24:25
   |
LL |     let x: *mut dyn T = &S;
   |            ----------   ^^ types differ in mutability
   |            |
   |            expected due to this
   |
   = note: expected raw pointer `*mut dyn T`
                found reference `&S`

error[E0308]: mismatched types
  --> $DIR/dst-bad-coercions.rs:25:21
   |
LL |     let x: *mut S = &S;
   |            ------   ^^ types differ in mutability
   |            |
   |            expected due to this
   |
   = note: expected raw pointer `*mut S`
                found reference `&S`

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0308`.