-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc has proper heuristics for actually checkign whether a type allows being left uninitialized (by asking CTFE). We can now use this for our helper instead of rolling our own bad version with false positives.
- Loading branch information
Showing
5 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
error: this call for this type may be undefined behavior | ||
--> $DIR/uninit.rs:7:29 | ||
--> $DIR/uninit.rs:12:29 | ||
| | ||
LL | let _: usize = unsafe { MaybeUninit::uninit().assume_init() }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[deny(clippy::uninit_assumed_init)]` on by default | ||
|
||
error: this call for this type may be undefined behavior | ||
--> $DIR/uninit.rs:10:31 | ||
| | ||
LL | let _: [u8; 0] = unsafe { MaybeUninit::uninit().assume_init() }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: this call for this type may be undefined behavior | ||
--> $DIR/uninit.rs:25:29 | ||
--> $DIR/uninit.rs:33:29 | ||
| | ||
LL | let _: usize = unsafe { mem::MaybeUninit::uninit().assume_init() }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters