forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE
deny-by-default in e2024
- Loading branch information
1 parent
33422e7
commit 18c248b
Showing
4 changed files
with
160 additions
and
23 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
116 changes: 116 additions & 0 deletions
116
tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.e2024.stderr
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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
error: never type fallback affects this call to an `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:13:18 | ||
| | ||
LL | unsafe { mem::zeroed() } | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
= note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default | ||
|
||
error: never type fallback affects this call to an `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:30:13 | ||
| | ||
LL | core::mem::transmute(Zst) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this union access | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:47:18 | ||
| | ||
LL | unsafe { Union { a: () }.b } | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this raw pointer dereference | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:58:18 | ||
| | ||
LL | unsafe { *ptr::from_ref(&()).cast() } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this call to an `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:79:18 | ||
| | ||
LL | unsafe { internally_create(x) } | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this call to an `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:97:18 | ||
| | ||
LL | unsafe { zeroed() } | ||
| ^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:92:22 | ||
| | ||
LL | let zeroed = mem::zeroed; | ||
| ^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:115:17 | ||
| | ||
LL | let f = internally_create; | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this call to an `unsafe` method | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:140:13 | ||
| | ||
LL | S(marker::PhantomData).create_out_of_thin_air() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this call to an `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:158:19 | ||
| | ||
LL | match send_message::<_ /* ?0 */>() { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
... | ||
LL | msg_send!(); | ||
| ----------- in this macro invocation | ||
| | ||
= warning: this will change its meaning in a future release! | ||
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> | ||
= help: specify the type explicitly | ||
= note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
warning: the type `!` does not permit zero-initialization | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:13:18 | ||
| | ||
LL | unsafe { mem::zeroed() } | ||
| ^^^^^^^^^^^^^ this code causes undefined behavior when executed | ||
| | ||
= note: the `!` type has no valid value | ||
= note: `#[warn(invalid_value)]` on by default | ||
|
||
error: aborting due to 10 previous errors; 1 warning emitted | ||
|
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