Skip to content

Commit

Permalink
Auto merge of #98919 - 5225225:stricter-invalid-value, r=RalfJung
Browse files Browse the repository at this point in the history
Strengthen invalid_value lint to forbid uninit primitives, adjust docs to say that's UB

For context: rust-lang/rust#66151 (comment)

This does not make it a FCW, but it does explicitly state in the docs that uninit integers are UB.

This also doesn't affect any runtime behavior, uninit u32's will still successfully be created through mem::uninitialized.
  • Loading branch information
bors committed Aug 30, 2022
2 parents ce847be + 98fe5f7 commit 7ba06ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/ui/uninit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(stmt_expr_attributes)]
#![allow(clippy::let_unit_value)]
#![allow(clippy::let_unit_value, invalid_value)]

use std::mem::{self, MaybeUninit};

Expand Down

0 comments on commit 7ba06ec

Please sign in to comment.