Skip to content

Commit 6de28af

Browse files
committed
Ignore invalid_reference_casting lint
I believe this is a false positive. rust-lang/rust#121074 error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused --> src/arena.rs:81:30 | 81 | let arena = unsafe { &*(&**arena as *const dyn Send as *const Arena<T>) }; | ^^^^-------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | backing allocation comes from here | = note: casting from `dyn Send` (0 bytes) to `Arena<T>` (56 bytes) = note: `#[deny(invalid_reference_casting)]` on by default
1 parent 7916860 commit 6de28af

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl<T> FromIterator<T> for Slice<T>
6060
where
6161
T: 'static + Send + Clone,
6262
{
63+
#[allow(invalid_reference_casting)] // false positive: https://github.com/rust-lang/rust/issues/121074
6364
fn from_iter<I>(iter: I) -> Self
6465
where
6566
I: IntoIterator<Item = T>,

0 commit comments

Comments
 (0)