| 1 |
error[E0308]: mismatched types |
| 2 |
--> $DIR/transmute_mut.rs:17:36 |
| 3 |
| |
| 4 |
17 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); |
| 5 |
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _` |
| 6 |
| |
| 7 |
= note: expected type `usize` |
| 8 |
found mutable reference `&mut _` |
| 9 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 10 |
|
| 11 |
error[E0308]: mismatched types |
| 12 |
--> $DIR/transmute_mut.rs:17:36 |
| 13 |
| |
| 14 |
17 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); |
| 15 |
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _` |
| 16 |
| |
| 17 |
= note: expected type `usize` |
| 18 |
found mutable reference `&mut _` |
| 19 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 20 |
|
| 21 |
error[E0277]: the trait bound `DstA: FromBytes` is not satisfied |
| 22 |
--> $DIR/transmute_mut.rs:30:39 |
| 23 |
| |
| 24 |
30 | const DST_NOT_FROM_BYTES: &mut DstA = transmute_mut!(&mut SrcA); |
| 25 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `DstA` |
| 26 |
| |
| 27 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 28 |
|
| 29 |
error[E0277]: the trait bound `DstB: IntoBytes` is not satisfied |
| 30 |
--> $DIR/transmute_mut.rs:42:37 |
| 31 |
| |
| 32 |
42 | const DST_NOT_AS_BYTES: &mut DstB = transmute_mut!(&mut SrcB); |
| 33 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `DstB` |
| 34 |
| |
| 35 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 36 |
|
| 37 |
error[E0308]: mismatched types |
| 38 |
--> $DIR/transmute_mut.rs:47:59 |
| 39 |
| |
| 40 |
47 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); |
| 41 |
| ---------------^^^^^^- |
| 42 |
| | | |
| 43 |
| | expected `&mut _`, found `usize` |
| 44 |
| | help: consider mutably borrowing here: `&mut 0usize` |
| 45 |
| expected due to this |
| 46 |
| |
| 47 |
= note: expected mutable reference `&mut _` |
| 48 |
found type `usize` |
| 49 |
|
| 50 |
error[E0308]: mismatched types |
| 51 |
--> $DIR/transmute_mut.rs:58:53 |
| 52 |
| |
| 53 |
58 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); |
| 54 |
| ---------------^^^^^^- |
| 55 |
| | | |
| 56 |
| | expected `&mut _`, found `usize` |
| 57 |
| | help: consider mutably borrowing here: `&mut 0usize` |
| 58 |
| expected due to this |
| 59 |
| |
| 60 |
= note: expected mutable reference `&mut _` |
| 61 |
found type `usize` |
| 62 |
|
| 63 |
error[E0277]: the trait bound `SrcC: FromBytes` is not satisfied |
| 64 |
--> $DIR/transmute_mut.rs:70:39 |
| 65 |
| |
| 66 |
70 | const SRC_NOT_FROM_BYTES: &mut DstC = transmute_mut!(&mut SrcC); |
| 67 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `SrcC` |
| 68 |
| |
| 69 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 70 |
|
| 71 |
error[E0277]: the trait bound `SrcD: IntoBytes` is not satisfied |
| 72 |
--> $DIR/transmute_mut.rs:82:37 |
| 73 |
| |
| 74 |
82 | const SRC_NOT_AS_BYTES: &mut DstD = transmute_mut!(&mut SrcD); |
| 75 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `SrcD` |
| 76 |
| |
| 77 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 78 |
|
| 79 |
error[E0599]: the method `transmute_mut` exists for struct `Wrap<&mut [u8], &mut [u8; 1]>`, but its trait bounds were not satisfied |
| 80 |
--> $DIR/transmute_mut.rs:87:35 |
| 81 |
| |
| 82 |
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); |
| 83 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&mut [u8], &mut [u8; 1]>` due to unsatisfied trait bounds |
| 84 |
| |
| 85 |
::: $WORKSPACE/src/util/macro_util.rs:694:1 |
| 86 |
| |
| 87 |
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>); |
| 88 |
| --------------------------------------------------------- doesn't satisfy `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst` |
| 89 |
| |
| 90 |
= note: the following trait bounds were not satisfied: |
| 91 |
`[u8]: Sized` |
| 92 |
`<[u8; 1] as KnownLayout>::PointerMetadata = usize` |
| 93 |
which is required by `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst` |
| 94 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 95 |
|
| 96 |
error[E0308]: mismatched types |
| 97 |
--> $DIR/transmute_mut.rs:52:37 |
| 98 |
| |
| 99 |
52 | let _: &mut u8 = transmute_mut!(&0u8); |
| 100 |
| ---------------^^^^- |
| 101 |
| | | |
| 102 |
| | types differ in mutability |
| 103 |
| expected due to this |
| 104 |
| |
| 105 |
= note: expected mutable reference `&mut _` |
| 106 |
found reference `&u8` |
| 107 |
|
| 108 |
error: aborting due to 10 previous errors |
| 109 |
|
| 110 |
Some errors have detailed explanations: E0277, E0308, E0599. |
| 111 |
For more information about an error, try `rustc --explain E0277`. |