Skip to content

Commit 434221b

Browse files
committed
bless tests
1 parent a02db86 commit 434221b

File tree

2 files changed

+39
-9
lines changed

2 files changed

+39
-9
lines changed

tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ fn _zero() {
77
if false {
88
unsafe { mem::zeroed() }
99
//~^ warn: never type fallback affects this call to an `unsafe` function
10+
//~| warn: this will change its meaning in a future release!
1011
} else {
1112
return;
1213
};
@@ -21,6 +22,7 @@ fn _trans() {
2122
struct Zst;
2223
core::mem::transmute(Zst)
2324
//~^ warn: never type fallback affects this call to an `unsafe` function
25+
//~| warn: this will change its meaning in a future release!
2426
}
2527
} else {
2628
return;
@@ -36,6 +38,7 @@ fn _union() {
3638

3739
unsafe { Union { a: () }.b }
3840
//~^ warn: never type fallback affects this union access
41+
//~| warn: this will change its meaning in a future release!
3942
} else {
4043
return;
4144
};
@@ -45,6 +48,7 @@ fn _deref() {
4548
if false {
4649
unsafe { *ptr::from_ref(&()).cast() }
4750
//~^ warn: never type fallback affects this raw pointer dereference
51+
//~| warn: this will change its meaning in a future release!
4852
} else {
4953
return;
5054
};
@@ -62,6 +66,7 @@ fn _only_generics() {
6266

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

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

7783
unsafe { zeroed() }
7884
//~^ warn: never type fallback affects this call to an `unsafe` function
85+
//~| warn: this will change its meaning in a future release!
7986
} else {
8087
return;
8188
};
@@ -90,6 +97,7 @@ fn _only_generics_stored_function() {
9097
let x = None;
9198
let f = internally_create;
9299
//~^ warn: never type fallback affects this `unsafe` function
100+
//~| warn: this will change its meaning in a future release!
93101

94102
unsafe { f(x) }
95103

@@ -113,6 +121,7 @@ fn _method() {
113121
unsafe {
114122
S(marker::PhantomData).create_out_of_thin_air()
115123
//~^ warn: never type fallback affects this call to an `unsafe` method
124+
//~| warn: this will change its meaning in a future release!
116125
}
117126
} else {
118127
return;
@@ -129,6 +138,7 @@ fn _objc() {
129138
() => {
130139
match send_message::<_ /* ?0 */>() {
131140
//~^ warn: never type fallback affects this call to an `unsafe` function
141+
//~| warn: this will change its meaning in a future release!
132142
Ok(x) => x,
133143
Err(_) => loop {},
134144
}

tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.stderr

+29-9
Original file line numberDiff line numberDiff line change
@@ -4,82 +4,102 @@ warning: never type fallback affects this call to an `unsafe` function
44
LL | unsafe { mem::zeroed() }
55
| ^^^^^^^^^^^^^
66
|
7+
= warning: this will change its meaning in a future release!
8+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
79
= help: specify the type explicitly
810
= note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default
911

1012
warning: never type fallback affects this call to an `unsafe` function
11-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:22:13
13+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:23:13
1214
|
1315
LL | core::mem::transmute(Zst)
1416
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1517
|
18+
= warning: this will change its meaning in a future release!
19+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
1620
= help: specify the type explicitly
1721

1822
warning: never type fallback affects this union access
19-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:37:18
23+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:39:18
2024
|
2125
LL | unsafe { Union { a: () }.b }
2226
| ^^^^^^^^^^^^^^^^^
2327
|
28+
= warning: this will change its meaning in a future release!
29+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
2430
= help: specify the type explicitly
2531

2632
warning: never type fallback affects this raw pointer dereference
27-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:46:18
33+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:49:18
2834
|
2935
LL | unsafe { *ptr::from_ref(&()).cast() }
3036
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
3137
|
38+
= warning: this will change its meaning in a future release!
39+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
3240
= help: specify the type explicitly
3341

3442
warning: never type fallback affects this call to an `unsafe` function
35-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:63:18
43+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:67:18
3644
|
3745
LL | unsafe { internally_create(x) }
3846
| ^^^^^^^^^^^^^^^^^^^^
3947
|
48+
= warning: this will change its meaning in a future release!
49+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
4050
= help: specify the type explicitly
4151

4252
warning: never type fallback affects this call to an `unsafe` function
43-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:77:18
53+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:83:18
4454
|
4555
LL | unsafe { zeroed() }
4656
| ^^^^^^^^
4757
|
58+
= warning: this will change its meaning in a future release!
59+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
4860
= help: specify the type explicitly
4961

5062
warning: never type fallback affects this `unsafe` function
51-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:74:22
63+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:79:22
5264
|
5365
LL | let zeroed = mem::zeroed;
5466
| ^^^^^^^^^^^
5567
|
68+
= warning: this will change its meaning in a future release!
69+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
5670
= help: specify the type explicitly
5771

5872
warning: never type fallback affects this `unsafe` function
59-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:91:17
73+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:98:17
6074
|
6175
LL | let f = internally_create;
6276
| ^^^^^^^^^^^^^^^^^
6377
|
78+
= warning: this will change its meaning in a future release!
79+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
6480
= help: specify the type explicitly
6581

6682
warning: never type fallback affects this call to an `unsafe` method
67-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:114:13
83+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:122:13
6884
|
6985
LL | S(marker::PhantomData).create_out_of_thin_air()
7086
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7187
|
88+
= warning: this will change its meaning in a future release!
89+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
7290
= help: specify the type explicitly
7391

7492
warning: never type fallback affects this call to an `unsafe` function
75-
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:130:19
93+
--> $DIR/lint-never-type-fallback-flowing-into-unsafe.rs:139:19
7694
|
7795
LL | match send_message::<_ /* ?0 */>() {
7896
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7997
...
8098
LL | msg_send!();
8199
| ----------- in this macro invocation
82100
|
101+
= warning: this will change its meaning in a future release!
102+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
83103
= help: specify the type explicitly
84104
= note: this warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)
85105

0 commit comments

Comments
 (0)