-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
a hard error in e2024
- Loading branch information
1 parent
33422e7
commit 639d406
Showing
5 changed files
with
159 additions
and
48 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
86 changes: 86 additions & 0 deletions
86
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,86 @@ | ||
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() } | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= 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:29:13 | ||
| | ||
LL | core::mem::transmute(Zst) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this union access | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18 | ||
| | ||
LL | unsafe { Union { a: () }.b } | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this raw pointer dereference | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:57:18 | ||
| | ||
LL | unsafe { *ptr::from_ref(&()).cast() } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= 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:78:18 | ||
| | ||
LL | unsafe { internally_create(x) } | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= 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:96:18 | ||
| | ||
LL | unsafe { zeroed() } | ||
| ^^^^^^^^ | ||
| | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:22 | ||
| | ||
LL | let zeroed = mem::zeroed; | ||
| ^^^^^^^^^^^ | ||
| | ||
= help: specify the type explicitly | ||
|
||
error: never type fallback affects this `unsafe` function | ||
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:17 | ||
| | ||
LL | let f = internally_create; | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= 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:139:13 | ||
| | ||
LL | S(marker::PhantomData).create_out_of_thin_air() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= 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:157:19 | ||
| | ||
LL | match send_message::<_ /* ?0 */>() { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
... | ||
LL | msg_send!(); | ||
| ----------- in this macro invocation | ||
| | ||
= 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) | ||
|
||
error: aborting due to 10 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