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