You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#132978 - WaffleLapkin:very-semantic-change-kind, r=compiler-errors
Mention both release *and* edition breakage for never type lints
This PR makes ~~two changes~~ a change to the never type lints (`dependency_on_unit_never_type_fallback` and `never_type_fallback_flowing_into_unsafe`):
1. Change the wording of the note to mention that the breaking change will be made in an edition _and_ in a future release
2. ~~Make these warnings be reported in deps (hopefully the lints are matured enough)~~
r? ``@compiler-errors``
cc ``@ehuss``
closesrust-lang#132930
Copy file name to clipboardExpand all lines: tests/ui/editions/never-type-fallback-breaking.e2021.fixed
+3-3
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ fn main() {
16
16
17
17
fn m() {
18
18
//[e2021]~^ this function depends on never type fallback being `()`
19
-
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19
+
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
20
20
let x: () = match true {
21
21
true => Default::default(),
22
22
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
@@ -28,7 +28,7 @@ fn m() {
28
28
29
29
fn q() -> Option<()> {
30
30
//[e2021]~^ this function depends on never type fallback being `()`
31
-
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
31
+
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
//[e2021]~^ this function depends on never type fallback being `()`
48
-
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
48
+
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
49
49
help::<(), _>(1)?;
50
50
//[e2024]~^ error: the trait bound `(): From<!>` is not satisfied
Copy file name to clipboardExpand all lines: tests/ui/editions/never-type-fallback-breaking.e2021.stderr
+3-3
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
4
4
LL | fn m() {
5
5
| ^^^^^^
6
6
|
7
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
8
8
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
9
9
= help: specify the types explicitly
10
10
note: in edition 2024, the requirement `!: Default` will fail
@@ -24,7 +24,7 @@ warning: this function depends on never type fallback being `()`
24
24
LL | fn q() -> Option<()> {
25
25
| ^^^^^^^^^^^^^^^^^^^^
26
26
|
27
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
28
28
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
29
29
= help: specify the types explicitly
30
30
note: in edition 2024, the requirement `!: Default` will fail
@@ -43,7 +43,7 @@ warning: this function depends on never type fallback being `()`
43
43
LL | fn meow() -> Result<(), ()> {
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
45
|
46
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
46
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
47
47
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
48
48
= help: specify the types explicitly
49
49
note: in edition 2024, the requirement `(): From<!>` will fail
Copy file name to clipboardExpand all lines: tests/ui/editions/never-type-fallback-breaking.rs
+3-3
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ fn main() {
16
16
17
17
fnm(){
18
18
//[e2021]~^ this function depends on never type fallback being `()`
19
-
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19
+
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
20
20
let x = matchtrue{
21
21
true => Default::default(),
22
22
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
@@ -28,7 +28,7 @@ fn m() {
28
28
29
29
fnq() -> Option<()>{
30
30
//[e2021]~^ this function depends on never type fallback being `()`
31
-
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
31
+
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
//[e2021]~^ this function depends on never type fallback being `()`
48
-
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
48
+
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
49
49
help(1)?;
50
50
//[e2024]~^ error: the trait bound `(): From<!>` is not satisfied
Copy file name to clipboardExpand all lines: tests/ui/never_type/defaulted-never-note.nofallback.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
4
4
LL | fn smeg() {
5
5
| ^^^^^^^^^
6
6
|
7
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
8
8
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
9
9
= help: specify the types explicitly
10
10
note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail
//[nofallback]~^ warn: this function depends on never type fallback being `()`
30
-
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
30
+
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
Copy file name to clipboardExpand all lines: tests/ui/never_type/dependency-on-fallback-to-unit.rs
+2-2
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ fn main() {
7
7
8
8
fndef(){
9
9
//~^ warn: this function depends on never type fallback being `()`
10
-
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
10
+
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
//~^ warn: this function depends on never type fallback being `()`
21
-
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
21
+
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
Copy file name to clipboardExpand all lines: tests/ui/never_type/dependency-on-fallback-to-unit.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
4
4
LL | fn def() {
5
5
| ^^^^^^^^
6
6
|
7
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
8
8
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
9
9
= help: specify the types explicitly
10
10
note: in edition 2024, the requirement `!: Default` will fail
@@ -24,7 +24,7 @@ warning: this function depends on never type fallback being `()`
24
24
LL | fn question_mark() -> Result<(), ()> {
25
25
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
26
|
27
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
28
28
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
29
29
= help: specify the types explicitly
30
30
note: in edition 2024, the requirement `!: Default` will fail
0 commit comments