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
This line is unsound. Creating an invalid timer is UB itself, even if the value is never used. The timer could contain types which the zero valued is invalid, such as &T or NonZeroU32.
Producing an invalid value, even in private fields and locals. “Producing” a value happens any time a value is assigned to or read from a place, passed to a function/primitive operation or returned from a function/primitive operation.
Possible solutions:
fn timer_mut(&mut self) -> &mut Timer, but then the caller can't reconstruct the timer.
store a Option<Timer> in Self.
The text was updated successfully, but these errors were encountered:
bitbang-hal/src/spi.rs
Line 120 in 6631f50
This line is unsound. Creating an invalid timer is UB itself, even if the value is never used. The timer could contain types which the zero valued is invalid, such as
&T
orNonZeroU32
.See https://doc.rust-lang.org/reference/behavior-considered-undefined.html
Possible solutions:
fn timer_mut(&mut self) -> &mut Timer
, but then the caller can't reconstruct the timer.Option<Timer>
inSelf
.The text was updated successfully, but these errors were encountered: