Skip to content

Commit d4bd422

Browse files
committed
Fix tidy errors
1 parent 1ed39bc commit d4bd422

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/test/ui/never-fallback/obj.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ fn unconstrained_return<T>() -> Result<T, String> {
1010
}
1111

1212
fn foo() {
13-
let a = || {
14-
match unconstrained_return::<_>() { //~ ERROR Fallback to `!` may introduce undefined behavior
13+
let a = || {
14+
match unconstrained_return::<_>() { //~ ERROR Fallback to `!` may introduce undefined
1515
Ok(x) => x, // `x` has type `_`, which is unconstrained
1616
Err(s) => panic!(s), // … except for unifying with the type of `panic!()`
1717
// so that both `match` arms have the same type.
1818
// Therefore `_` resolves to `!` and we "return" an `Ok(!)` value.
1919
}
2020
};
21-
21+
2222
let cast: &dyn FnOnce() -> _ = &a;
2323
println!("Return type: {:?}", get_type(cast));
2424
}

src/test/ui/never-fallback/obj_implicit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ fn unconstrained_return<T>() -> Result<T, String> {
1010
}
1111

1212
fn foo() {
13-
let a = || {
13+
let a = || {
1414
match unconstrained_return() { //~ ERROR Fallback to `!` may introduce undefined behavior
1515
Ok(x) => x, // `x` has type `_`, which is unconstrained
1616
Err(s) => panic!(s), // … except for unifying with the type of `panic!()`
1717
// so that both `match` arms have the same type.
1818
// Therefore `_` resolves to `!` and we "return" an `Ok(!)` value.
1919
}
2020
};
21-
21+
2222
let cast: &dyn FnOnce() -> _ = &a;
2323
println!("Return type: {:?}", get_type(cast));
2424
}

0 commit comments

Comments
 (0)