Skip to content

Commit c598e6a

Browse files
WaffleLapkinwaffle.lapkin@gmail.com
authored andcommitted
bless ui tests
1 parent 2744060 commit c598e6a

24 files changed

+237
-251
lines changed

src/doc/edition-guide

Submodule edition-guide deleted from e2ed891

tests/ui/editions/never-type-fallback-breaking.e2021.fixed

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
//@[e2021] edition: 2021
44
//@[e2024] edition: 2024
55
//
6-
//@[e2021] run-pass
76
//@[e2021] run-rustfix
8-
//@[e2024] check-fail
97

108
fn main() {
119
m();
@@ -16,8 +14,8 @@ fn main() {
1614
}
1715

1816
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!
2119
let x: () = match true {
2220
true => Default::default(),
2321
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
@@ -28,8 +26,8 @@ fn m() {
2826
}
2927

3028
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!
3331
fn deserialize<T: Default>() -> Option<T> {
3432
Some(T::default())
3533
}
@@ -45,8 +43,8 @@ fn help<'a: 'a, T: Into<()>, U>(_: U) -> Result<T, ()> {
4543
Err(())
4644
}
4745
fn meow() -> Result<(), ()> {
48-
//[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!
5048
help::<(), _>(1)?;
5149
//[e2024]~^ error: the trait bound `(): From<!>` is not satisfied
5250
Ok(())
@@ -57,8 +55,8 @@ pub fn takes_apit<T>(_y: impl Fn() -> T) -> Result<T, ()> {
5755
}
5856

5957
pub fn fallback_return() -> Result<(), ()> {
60-
//[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!
6260
takes_apit::<()>(|| Default::default())?;
6361
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
6462
Ok(())
@@ -71,8 +69,8 @@ fn mk<T>() -> Result<T, ()> {
7169
fn takes_apit2(_x: impl Default) {}
7270

7371
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!
7674
takes_apit2(mk::<()>()?);
7775
//[e2024]~^ error: the trait bound `!: Default` is not satisfied
7876
Ok(())

tests/ui/editions/never-type-fallback-breaking.e2021.stderr

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
warning: this function depends on never type fallback being `()`
2-
--> $DIR/never-type-fallback-breaking.rs:18:1
1+
error: this function depends on never type fallback being `()`
2+
--> $DIR/never-type-fallback-breaking.rs:16:1
33
|
44
LL | fn m() {
55
| ^^^^^^
@@ -8,18 +8,18 @@ LL | fn m() {
88
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
99
= help: specify the types explicitly
1010
note: in edition 2024, the requirement `!: Default` will fail
11-
--> $DIR/never-type-fallback-breaking.rs:22:17
11+
--> $DIR/never-type-fallback-breaking.rs:20:17
1212
|
1313
LL | true => Default::default(),
1414
| ^^^^^^^^^^^^^^^^^^
15-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
15+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
1616
help: use `()` annotations to avoid fallback changes
1717
|
1818
LL | let x: () = match true {
1919
| ++++
2020

21-
warning: this function depends on never type fallback being `()`
22-
--> $DIR/never-type-fallback-breaking.rs:30:1
21+
error: this function depends on never type fallback being `()`
22+
--> $DIR/never-type-fallback-breaking.rs:28:1
2323
|
2424
LL | fn q() -> Option<()> {
2525
| ^^^^^^^^^^^^^^^^^^^^
@@ -28,7 +28,7 @@ LL | fn q() -> Option<()> {
2828
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
2929
= help: specify the types explicitly
3030
note: in edition 2024, the requirement `!: Default` will fail
31-
--> $DIR/never-type-fallback-breaking.rs:37:5
31+
--> $DIR/never-type-fallback-breaking.rs:35:5
3232
|
3333
LL | deserialize()?;
3434
| ^^^^^^^^^^^^^
@@ -37,8 +37,8 @@ help: use `()` annotations to avoid fallback changes
3737
LL | deserialize::<()>()?;
3838
| ++++++
3939

40-
warning: this function depends on never type fallback being `()`
41-
--> $DIR/never-type-fallback-breaking.rs:47:1
40+
error: this function depends on never type fallback being `()`
41+
--> $DIR/never-type-fallback-breaking.rs:45:1
4242
|
4343
LL | fn meow() -> Result<(), ()> {
4444
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL | fn meow() -> Result<(), ()> {
4747
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
4848
= help: specify the types explicitly
4949
note: in edition 2024, the requirement `(): From<!>` will fail
50-
--> $DIR/never-type-fallback-breaking.rs:50:5
50+
--> $DIR/never-type-fallback-breaking.rs:48:5
5151
|
5252
LL | help(1)?;
5353
| ^^^^^^^
@@ -56,8 +56,8 @@ help: use `()` annotations to avoid fallback changes
5656
LL | help::<(), _>(1)?;
5757
| +++++++++
5858

59-
warning: this function depends on never type fallback being `()`
60-
--> $DIR/never-type-fallback-breaking.rs:59:1
59+
error: this function depends on never type fallback being `()`
60+
--> $DIR/never-type-fallback-breaking.rs:57:1
6161
|
6262
LL | pub fn fallback_return() -> Result<(), ()> {
6363
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -66,7 +66,7 @@ LL | pub fn fallback_return() -> Result<(), ()> {
6666
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
6767
= help: specify the types explicitly
6868
note: in edition 2024, the requirement `!: Default` will fail
69-
--> $DIR/never-type-fallback-breaking.rs:62:19
69+
--> $DIR/never-type-fallback-breaking.rs:60:19
7070
|
7171
LL | takes_apit(|| Default::default())?;
7272
| ^^^^^^^^^^^^^^^^^^
@@ -75,8 +75,8 @@ help: use `()` annotations to avoid fallback changes
7575
LL | takes_apit::<()>(|| Default::default())?;
7676
| ++++++
7777

78-
warning: this function depends on never type fallback being `()`
79-
--> $DIR/never-type-fallback-breaking.rs:73:1
78+
error: this function depends on never type fallback being `()`
79+
--> $DIR/never-type-fallback-breaking.rs:71:1
8080
|
8181
LL | fn fully_apit() -> Result<(), ()> {
8282
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL | fn fully_apit() -> Result<(), ()> {
8585
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
8686
= help: specify the types explicitly
8787
note: in edition 2024, the requirement `!: Default` will fail
88-
--> $DIR/never-type-fallback-breaking.rs:76:17
88+
--> $DIR/never-type-fallback-breaking.rs:74:17
8989
|
9090
LL | takes_apit2(mk()?);
9191
| ^^^^^
@@ -94,11 +94,11 @@ help: use `()` annotations to avoid fallback changes
9494
LL | takes_apit2(mk::<()>()?);
9595
| ++++++
9696

97-
warning: 5 warnings emitted
97+
error: aborting due to 5 previous errors
9898

9999
Future incompatibility report: Future breakage diagnostic:
100-
warning: this function depends on never type fallback being `()`
101-
--> $DIR/never-type-fallback-breaking.rs:18:1
100+
error: this function depends on never type fallback being `()`
101+
--> $DIR/never-type-fallback-breaking.rs:16:1
102102
|
103103
LL | fn m() {
104104
| ^^^^^^
@@ -107,19 +107,19 @@ LL | fn m() {
107107
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
108108
= help: specify the types explicitly
109109
note: in edition 2024, the requirement `!: Default` will fail
110-
--> $DIR/never-type-fallback-breaking.rs:22:17
110+
--> $DIR/never-type-fallback-breaking.rs:20:17
111111
|
112112
LL | true => Default::default(),
113113
| ^^^^^^^^^^^^^^^^^^
114-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
114+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
115115
help: use `()` annotations to avoid fallback changes
116116
|
117117
LL | let x: () = match true {
118118
| ++++
119119

120120
Future breakage diagnostic:
121-
warning: this function depends on never type fallback being `()`
122-
--> $DIR/never-type-fallback-breaking.rs:30:1
121+
error: this function depends on never type fallback being `()`
122+
--> $DIR/never-type-fallback-breaking.rs:28:1
123123
|
124124
LL | fn q() -> Option<()> {
125125
| ^^^^^^^^^^^^^^^^^^^^
@@ -128,19 +128,19 @@ LL | fn q() -> Option<()> {
128128
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
129129
= help: specify the types explicitly
130130
note: in edition 2024, the requirement `!: Default` will fail
131-
--> $DIR/never-type-fallback-breaking.rs:37:5
131+
--> $DIR/never-type-fallback-breaking.rs:35:5
132132
|
133133
LL | deserialize()?;
134134
| ^^^^^^^^^^^^^
135-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
135+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
136136
help: use `()` annotations to avoid fallback changes
137137
|
138138
LL | deserialize::<()>()?;
139139
| ++++++
140140

141141
Future breakage diagnostic:
142-
warning: this function depends on never type fallback being `()`
143-
--> $DIR/never-type-fallback-breaking.rs:47:1
142+
error: this function depends on never type fallback being `()`
143+
--> $DIR/never-type-fallback-breaking.rs:45:1
144144
|
145145
LL | fn meow() -> Result<(), ()> {
146146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -149,19 +149,19 @@ LL | fn meow() -> Result<(), ()> {
149149
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
150150
= help: specify the types explicitly
151151
note: in edition 2024, the requirement `(): From<!>` will fail
152-
--> $DIR/never-type-fallback-breaking.rs:50:5
152+
--> $DIR/never-type-fallback-breaking.rs:48:5
153153
|
154154
LL | help(1)?;
155155
| ^^^^^^^
156-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
156+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
157157
help: use `()` annotations to avoid fallback changes
158158
|
159159
LL | help::<(), _>(1)?;
160160
| +++++++++
161161

162162
Future breakage diagnostic:
163-
warning: this function depends on never type fallback being `()`
164-
--> $DIR/never-type-fallback-breaking.rs:59:1
163+
error: this function depends on never type fallback being `()`
164+
--> $DIR/never-type-fallback-breaking.rs:57:1
165165
|
166166
LL | pub fn fallback_return() -> Result<(), ()> {
167167
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -170,19 +170,19 @@ LL | pub fn fallback_return() -> Result<(), ()> {
170170
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
171171
= help: specify the types explicitly
172172
note: in edition 2024, the requirement `!: Default` will fail
173-
--> $DIR/never-type-fallback-breaking.rs:62:19
173+
--> $DIR/never-type-fallback-breaking.rs:60:19
174174
|
175175
LL | takes_apit(|| Default::default())?;
176176
| ^^^^^^^^^^^^^^^^^^
177-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
177+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
178178
help: use `()` annotations to avoid fallback changes
179179
|
180180
LL | takes_apit::<()>(|| Default::default())?;
181181
| ++++++
182182

183183
Future breakage diagnostic:
184-
warning: this function depends on never type fallback being `()`
185-
--> $DIR/never-type-fallback-breaking.rs:73:1
184+
error: this function depends on never type fallback being `()`
185+
--> $DIR/never-type-fallback-breaking.rs:71:1
186186
|
187187
LL | fn fully_apit() -> Result<(), ()> {
188188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -191,11 +191,11 @@ LL | fn fully_apit() -> Result<(), ()> {
191191
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
192192
= help: specify the types explicitly
193193
note: in edition 2024, the requirement `!: Default` will fail
194-
--> $DIR/never-type-fallback-breaking.rs:76:17
194+
--> $DIR/never-type-fallback-breaking.rs:74:17
195195
|
196196
LL | takes_apit2(mk()?);
197197
| ^^^^^
198-
= note: `#[warn(dependency_on_unit_never_type_fallback)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
198+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
199199
help: use `()` annotations to avoid fallback changes
200200
|
201201
LL | takes_apit2(mk::<()>()?);

tests/ui/editions/never-type-fallback-breaking.e2024.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `!: Default` is not satisfied
2-
--> $DIR/never-type-fallback-breaking.rs:22:17
2+
--> $DIR/never-type-fallback-breaking.rs:20:17
33
|
44
LL | true => Default::default(),
55
| ^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `!`
@@ -8,21 +8,21 @@ LL | true => Default::default(),
88
= help: you might have intended to use the type `()` here instead
99

1010
error[E0277]: the trait bound `!: Default` is not satisfied
11-
--> $DIR/never-type-fallback-breaking.rs:37:5
11+
--> $DIR/never-type-fallback-breaking.rs:35:5
1212
|
1313
LL | deserialize()?;
1414
| ^^^^^^^^^^^^^ the trait `Default` is not implemented for `!`
1515
|
1616
= note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information)
1717
= help: you might have intended to use the type `()` here instead
1818
note: required by a bound in `deserialize`
19-
--> $DIR/never-type-fallback-breaking.rs:33:23
19+
--> $DIR/never-type-fallback-breaking.rs:31:23
2020
|
2121
LL | fn deserialize<T: Default>() -> Option<T> {
2222
| ^^^^^^^ required by this bound in `deserialize`
2323

2424
error[E0277]: the trait bound `(): From<!>` is not satisfied
25-
--> $DIR/never-type-fallback-breaking.rs:50:5
25+
--> $DIR/never-type-fallback-breaking.rs:48:5
2626
|
2727
LL | help(1)?;
2828
| ^^^^^^^ the trait `From<!>` is not implemented for `()`
@@ -39,13 +39,13 @@ LL | help(1)?;
3939
and 4 others
4040
= note: required for `!` to implement `Into<()>`
4141
note: required by a bound in `help`
42-
--> $DIR/never-type-fallback-breaking.rs:44:20
42+
--> $DIR/never-type-fallback-breaking.rs:42:20
4343
|
4444
LL | fn help<'a: 'a, T: Into<()>, U>(_: U) -> Result<T, ()> {
4545
| ^^^^^^^^ required by this bound in `help`
4646

4747
error[E0277]: the trait bound `!: Default` is not satisfied
48-
--> $DIR/never-type-fallback-breaking.rs:62:19
48+
--> $DIR/never-type-fallback-breaking.rs:60:19
4949
|
5050
LL | takes_apit(|| Default::default())?;
5151
| ^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `!`
@@ -54,7 +54,7 @@ LL | takes_apit(|| Default::default())?;
5454
= help: you might have intended to use the type `()` here instead
5555

5656
error[E0277]: the trait bound `!: Default` is not satisfied
57-
--> $DIR/never-type-fallback-breaking.rs:76:17
57+
--> $DIR/never-type-fallback-breaking.rs:74:17
5858
|
5959
LL | takes_apit2(mk()?);
6060
| ----------- ^^^^^ the trait `Default` is not implemented for `!`
@@ -64,7 +64,7 @@ LL | takes_apit2(mk()?);
6464
= note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information)
6565
= help: you might have intended to use the type `()` here instead
6666
note: required by a bound in `takes_apit2`
67-
--> $DIR/never-type-fallback-breaking.rs:71:25
67+
--> $DIR/never-type-fallback-breaking.rs:69:25
6868
|
6969
LL | fn takes_apit2(_x: impl Default) {}
7070
| ^^^^^^^ required by this bound in `takes_apit2`

0 commit comments

Comments
 (0)