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
Auto merge of #147900 - Zalathar:rollup-ril6jsi, r=Zalathar
Rollup of 3 pull requests
Successful merges:
- #146167 (Deny-by-default never type lints)
- #147382 (unused_must_use: Don't warn on `Result<(), Uninhabited>` or `ControlFlow<Uninhabited, ()>`)
- #147821 (Do not GC the current active incremental session directory)
r? `@ghost`
`@rustbot` modify labels: rollup
Copy file name to clipboardExpand all lines: tests/ui/editions/never-type-fallback-breaking.e2021.fixed
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,7 @@
3
3
//@[e2021] edition: 2021
4
4
//@[e2024] edition: 2024
5
5
//
6
-
//@[e2021] run-pass
7
6
//@[e2021] run-rustfix
8
-
//@[e2024] check-fail
9
7
10
8
fn main() {
11
9
m();
@@ -16,8 +14,8 @@ fn main() {
16
14
}
17
15
18
16
fn m() {
19
-
//[e2021]~^ WARN this function depends on never type fallback being `()`
20
-
//[e2021]~| 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!
17
+
//[e2021]~^ error: this function depends on never type fallback being `()`
18
+
//[e2021]~| 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!
21
19
let x: () = match true {
22
20
true => Default::default(),
23
21
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
@@ -28,8 +26,8 @@ fn m() {
28
26
}
29
27
30
28
fn q() -> Option<()> {
31
-
//[e2021]~^ WARN this function depends on never type fallback being `()`
32
-
//[e2021]~| 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!
29
+
//[e2021]~^ error: this function depends on never type fallback being `()`
30
+
//[e2021]~| 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!
//[e2021]~^ WARN this function depends on never type fallback being `()`
49
-
//[e2021]~| 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!
46
+
//[e2021]~^ error: this function depends on never type fallback being `()`
47
+
//[e2021]~| 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!
50
48
help::<(), _>(1)?;
51
49
//[e2024]~^ error: the trait bound `(): From<!>` is not satisfied
//[e2021]~^ WARN this function depends on never type fallback being `()`
61
-
//[e2021]~| 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!
58
+
//[e2021]~^ error: this function depends on never type fallback being `()`
59
+
//[e2021]~| 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!
62
60
takes_apit::<()>(|| Default::default())?;
63
61
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
64
62
Ok(())
@@ -71,8 +69,8 @@ fn mk<T>() -> Result<T, ()> {
71
69
fn takes_apit2(_x: impl Default) {}
72
70
73
71
fn fully_apit() -> Result<(), ()> {
74
-
//[e2021]~^ WARN this function depends on never type fallback being `()`
75
-
//[e2021]~| 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!
72
+
//[e2021]~^ error: this function depends on never type fallback being `()`
73
+
//[e2021]~| 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!
76
74
takes_apit2(mk::<()>()?);
77
75
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
0 commit comments