Skip to content

Commit

Permalink
bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed May 19, 2024
1 parent a02db86 commit 434221b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fn _zero() {
if false {
unsafe { mem::zeroed() }
//~^ warn: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release!
} else {
return;
};
Expand All @@ -21,6 +22,7 @@ fn _trans() {
struct Zst;
core::mem::transmute(Zst)
//~^ warn: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release!
}
} else {
return;
Expand All @@ -36,6 +38,7 @@ fn _union() {

unsafe { Union { a: () }.b }
//~^ warn: never type fallback affects this union access
//~| warn: this will change its meaning in a future release!
} else {
return;
};
Expand All @@ -45,6 +48,7 @@ fn _deref() {
if false {
unsafe { *ptr::from_ref(&()).cast() }
//~^ warn: never type fallback affects this raw pointer dereference
//~| warn: this will change its meaning in a future release!
} else {
return;
};
Expand All @@ -62,6 +66,7 @@ fn _only_generics() {

unsafe { internally_create(x) }
//~^ warn: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release!

x.unwrap()
} else {
Expand All @@ -73,9 +78,11 @@ fn _stored_function() {
if false {
let zeroed = mem::zeroed;
//~^ warn: never type fallback affects this `unsafe` function
//~| warn: this will change its meaning in a future release!

unsafe { zeroed() }
//~^ warn: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release!
} else {
return;
};
Expand All @@ -90,6 +97,7 @@ fn _only_generics_stored_function() {
let x = None;
let f = internally_create;
//~^ warn: never type fallback affects this `unsafe` function
//~| warn: this will change its meaning in a future release!

unsafe { f(x) }

Expand All @@ -113,6 +121,7 @@ fn _method() {
unsafe {
S(marker::PhantomData).create_out_of_thin_air()
//~^ warn: never type fallback affects this call to an `unsafe` method
//~| warn: this will change its meaning in a future release!
}
} else {
return;
Expand All @@ -129,6 +138,7 @@ fn _objc() {
() => {
match send_message::<_ /* ?0 */>() {
//~^ warn: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release!
Ok(x) => x,
Err(_) => loop {},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,102 @@ warning: never type fallback affects this call to an `unsafe` function
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: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default

warning: never type fallback affects this call to an `unsafe` function
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:22:13
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:23: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

warning: never type fallback affects this union access
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:37:18
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:39: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

warning: never type fallback affects this raw pointer dereference
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:49: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

warning: never type fallback affects this call to an `unsafe` function
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:63:18
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:67: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

warning: never type fallback affects this call to an `unsafe` function
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:77:18
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:83: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

warning: never type fallback affects this `unsafe` function
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:74:22
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:79: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

warning: never type fallback affects this `unsafe` function
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:17
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:98: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

warning: never type fallback affects this call to an `unsafe` method
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:13
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:122: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

warning: never type fallback affects this call to an `unsafe` function
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:130:19
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:139: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 warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down

0 comments on commit 434221b

Please sign in to comment.