-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
--> src/green/node.rs:197:35
|
195 | let repr: &Repr = &self.ptr;
| -------- backing allocation comes from here
196 | unsafe {
197 | let repr: &ReprThin = &*(repr as *const Repr as *const ReprThin);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: casting from `ThinArc<GreenNodeHead, GreenChild>` (8 bytes) to `HeaderSlice<GreenNodeHead, [GreenChild; 0]>` (16 bytes)
= note: `#[deny(invalid_reference_casting)]` on by default
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
--> src/green/token.rs:139:35
|
138 | let repr: &Repr = &self.ptr;
| -------- backing allocation comes from here
139 | let repr: &ReprThin = &*(repr as *const Repr as *const ReprThin);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: casting from `ThinArc<GreenTokenHead, u8>` (8 bytes) to `HeaderSlice<GreenTokenHead, [u8; 0]>` (16 bytes)
error: could not compile `rowan` (lib) due to 2 previous errors
Metadata
Metadata
Assignees
Labels
No labels