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
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
+66-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
warning: this function depends on never type fallback being `()`
63
+
--> $DIR/never-type-fallback-breaking.rs:17:1
64
+
|
65
+
LL | fn m() {
66
+
| ^^^^^^
67
+
|
68
+
= 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!
69
+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
70
+
= help: specify the types explicitly
71
+
note: in edition 2024, the requirement `!: Default` will fail
72
+
--> $DIR/never-type-fallback-breaking.rs:21:17
73
+
|
74
+
LL | true => Default::default(),
75
+
| ^^^^^^^^^^^^^^^^^^
76
+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
77
+
help: use `()` annotations to avoid fallback changes
78
+
|
79
+
LL | let x: () = match true {
80
+
| ++++
81
+
82
+
Future breakage diagnostic:
83
+
warning: this function depends on never type fallback being `()`
84
+
--> $DIR/never-type-fallback-breaking.rs:29:1
85
+
|
86
+
LL | fn q() -> Option<()> {
87
+
| ^^^^^^^^^^^^^^^^^^^^
88
+
|
89
+
= 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!
90
+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
91
+
= help: specify the types explicitly
92
+
note: in edition 2024, the requirement `!: Default` will fail
93
+
--> $DIR/never-type-fallback-breaking.rs:36:5
94
+
|
95
+
LL | deserialize()?;
96
+
| ^^^^^^^^^^^^^
97
+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
98
+
help: use `()` annotations to avoid fallback changes
99
+
|
100
+
LL | deserialize::<()>()?;
101
+
| ++++++
102
+
103
+
Future breakage diagnostic:
104
+
warning: this function depends on never type fallback being `()`
105
+
--> $DIR/never-type-fallback-breaking.rs:46:1
106
+
|
107
+
LL | fn meow() -> Result<(), ()> {
108
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
109
+
|
110
+
= 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!
111
+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
112
+
= help: specify the types explicitly
113
+
note: in edition 2024, the requirement `(): From<!>` will fail
114
+
--> $DIR/never-type-fallback-breaking.rs:49:5
115
+
|
116
+
LL | help(1)?;
117
+
| ^^^^^^^
118
+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
119
+
help: use `()` annotations to avoid fallback changes
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
+22-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
warning: this function depends on never type fallback being `()`
25
+
--> $DIR/defaulted-never-note.rs:28:1
26
+
|
27
+
LL | fn smeg() {
28
+
| ^^^^^^^^^
29
+
|
30
+
= 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!
31
+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
32
+
= help: specify the types explicitly
33
+
note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail
34
+
--> $DIR/defaulted-never-note.rs:32:9
35
+
|
36
+
LL | foo(_x);
37
+
| ^^
38
+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
39
+
help: use `()` annotations to avoid fallback changes
//[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
+44-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
warning: this function depends on never type fallback being `()`
44
+
--> $DIR/dependency-on-fallback-to-unit.rs:8:1
45
+
|
46
+
LL | fn def() {
47
+
| ^^^^^^^^
48
+
|
49
+
= 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!
50
+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
51
+
= help: specify the types explicitly
52
+
note: in edition 2024, the requirement `!: Default` will fail
53
+
--> $DIR/dependency-on-fallback-to-unit.rs:12:19
54
+
|
55
+
LL | false => <_>::default(),
56
+
| ^
57
+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
58
+
help: use `()` annotations to avoid fallback changes
59
+
|
60
+
LL | false => <()>::default(),
61
+
| ~~
62
+
63
+
Future breakage diagnostic:
64
+
warning: this function depends on never type fallback being `()`
65
+
--> $DIR/dependency-on-fallback-to-unit.rs:19:1
66
+
|
67
+
LL | fn question_mark() -> Result<(), ()> {
68
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69
+
|
70
+
= 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!
71
+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
72
+
= help: specify the types explicitly
73
+
note: in edition 2024, the requirement `!: Default` will fail
74
+
--> $DIR/dependency-on-fallback-to-unit.rs:22:5
75
+
|
76
+
LL | deserialize()?;
77
+
| ^^^^^^^^^^^^^
78
+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
79
+
help: use `()` annotations to avoid fallback changes
0 commit comments