Skip to content

Commit

Permalink
Fix tidy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Jan 18, 2020
1 parent 1ed39bc commit d4bd422
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/test/ui/never-fallback/obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ fn unconstrained_return<T>() -> Result<T, String> {
}

fn foo() {
let a = || {
match unconstrained_return::<_>() { //~ ERROR Fallback to `!` may introduce undefined behavior
let a = || {
match unconstrained_return::<_>() { //~ ERROR Fallback to `!` may introduce undefined
Ok(x) => x, // `x` has type `_`, which is unconstrained
Err(s) => panic!(s), // … except for unifying with the type of `panic!()`
// so that both `match` arms have the same type.
// Therefore `_` resolves to `!` and we "return" an `Ok(!)` value.
}
};

let cast: &dyn FnOnce() -> _ = &a;
println!("Return type: {:?}", get_type(cast));
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/never-fallback/obj_implicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ fn unconstrained_return<T>() -> Result<T, String> {
}

fn foo() {
let a = || {
let a = || {
match unconstrained_return() { //~ ERROR Fallback to `!` may introduce undefined behavior
Ok(x) => x, // `x` has type `_`, which is unconstrained
Err(s) => panic!(s), // … except for unifying with the type of `panic!()`
// so that both `match` arms have the same type.
// Therefore `_` resolves to `!` and we "return" an `Ok(!)` value.
}
};

let cast: &dyn FnOnce() -> _ = &a;
println!("Return type: {:?}", get_type(cast));
}
Expand Down

0 comments on commit d4bd422

Please sign in to comment.