Skip to content

Commit f0830c0

Browse files
committed
Add run-rustfix to tests/ui/issues/issue-92741.rs
1 parent 039f70e commit f0830c0

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::path::Path;
1010
const ENTRY_LIMIT: usize = 1000;
1111
// FIXME: The following limits should be reduced eventually.
1212
const ROOT_ENTRY_LIMIT: usize = 939;
13-
const ISSUES_ENTRY_LIMIT: usize = 2000;
13+
const ISSUES_ENTRY_LIMIT: usize = 2001;
1414

1515
fn check_entries(path: &Path, bad: &mut bool) {
1616
for dir in Walk::new(&path.join("ui")) {

tests/ui/issues/issue-92741.fixed

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// run-rustfix
2+
fn main() {}
3+
fn _foo() -> bool {
4+
if true { true } else { false }
5+
}
6+
7+
fn _bar() -> bool {
8+
if true { true } else { false }
9+
}
10+
11+
fn _baz() -> bool {
12+
if true { true } else { false }
13+
}

tests/ui/issues/issue-92741.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
// run-rustfix
12
fn main() {}
2-
fn foo() -> bool {
3-
& //~ ERROR 3:5: 5:36: mismatched types [E0308]
3+
fn _foo() -> bool {
4+
& //~ ERROR 4:5: 6:36: mismatched types [E0308]
45
mut
56
if true { true } else { false }
67
}
78

8-
fn bar() -> bool {
9-
& //~ ERROR 9:5: 10:40: mismatched types [E0308]
9+
fn _bar() -> bool {
10+
& //~ ERROR 10:5: 11:40: mismatched types [E0308]
1011
mut if true { true } else { false }
1112
}
1213

13-
fn baz() -> bool {
14-
& mut //~ ERROR 14:5: 15:36: mismatched types [E0308]
14+
fn _baz() -> bool {
15+
& mut //~ ERROR 15:5: 16:36: mismatched types [E0308]
1516
if true { true } else { false }
1617
}

tests/ui/issues/issue-92741.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-92741.rs:3:5
2+
--> $DIR/issue-92741.rs:4:5
33
|
4-
LL | fn foo() -> bool {
5-
| ---- expected `bool` because of return type
4+
LL | fn _foo() -> bool {
5+
| ---- expected `bool` because of return type
66
LL | / &
77
LL | | mut
88
LL | | if true { true } else { false }
@@ -15,10 +15,10 @@ LL - mut
1515
|
1616

1717
error[E0308]: mismatched types
18-
--> $DIR/issue-92741.rs:9:5
18+
--> $DIR/issue-92741.rs:10:5
1919
|
20-
LL | fn bar() -> bool {
21-
| ---- expected `bool` because of return type
20+
LL | fn _bar() -> bool {
21+
| ---- expected `bool` because of return type
2222
LL | / &
2323
LL | | mut if true { true } else { false }
2424
| |_______________________________________^ expected `bool`, found `&mut bool`
@@ -31,10 +31,10 @@ LL + if true { true } else { false }
3131
|
3232

3333
error[E0308]: mismatched types
34-
--> $DIR/issue-92741.rs:14:5
34+
--> $DIR/issue-92741.rs:15:5
3535
|
36-
LL | fn baz() -> bool {
37-
| ---- expected `bool` because of return type
36+
LL | fn _baz() -> bool {
37+
| ---- expected `bool` because of return type
3838
LL | / & mut
3939
LL | | if true { true } else { false }
4040
| |___________________________________^ expected `bool`, found `&mut bool`

0 commit comments

Comments
 (0)