You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// `mem::align_of::<U>()` is guaranteed to return a non-zero value, which in
// turn guarantees that this mod operation will not panic.
#[allow(clippy::arithmetic_side_effects)]
let remainder = t.addr() % mem::align_of::<U>();
remainder == 0
}
According to rust-lang/rust#62420, there's a small chance that this may be decided to be unsound (and it's not supported during const eval, although there are bigger problems regarding using addresses in const eval). We should figure out whether this is a risk we're comfortable with, and consider how we might mitigate it.
The text was updated successfully, but these errors were encountered:
We have code like the following in zerocopy as of this writing:
zerocopy/src/lib.rs
Lines 2323 to 2331 in 27aea67
According to rust-lang/rust#62420, there's a small chance that this may be decided to be unsound (and it's not supported during const eval, although there are bigger problems regarding using addresses in const eval). We should figure out whether this is a risk we're comfortable with, and consider how we might mitigate it.
The text was updated successfully, but these errors were encountered: