7

Apply noundef attribute to all scalar types which do not permit raw init by erik...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/94157
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

@erikdesjardins erikdesjardins commented 16 days ago

Beyond &/&mut/Box, this covers char, enum discriminants, NonZero*, etc.
All such types currently cause a Miri error if left uninitialized,
and an invalid_value lint in cases like mem::uninitialized::<char>().

Note that this does not change whether or not it is UB for u64 (or
other integer types with no invalid values) to be undef.

Fixes (partially) #74378.

r? @ghost (blocked on #94127)

@rustbot label S-blocked


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK