diff options
Diffstat (limited to 'tests/ui/never_type')
-rw-r--r-- | tests/ui/never_type/diverging-fallback-control-flow.rs | 12 | ||||
-rw-r--r-- | tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr | 2 | ||||
-rw-r--r-- | tests/ui/never_type/issue-13352.stderr | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/ui/never_type/diverging-fallback-control-flow.rs b/tests/ui/never_type/diverging-fallback-control-flow.rs index 45a3362fa..9f6cfc799 100644 --- a/tests/ui/never_type/diverging-fallback-control-flow.rs +++ b/tests/ui/never_type/diverging-fallback-control-flow.rs @@ -48,7 +48,7 @@ fn assignment_rev() { } fn if_then_else() { - let _x = if true { + let _x: () = if true { UnitDefault::default() } else { return; @@ -56,7 +56,7 @@ fn if_then_else() { } fn if_then_else_rev() { - let _x = if true { + let _x: () = if true { return; } else { UnitDefault::default() @@ -64,21 +64,21 @@ fn if_then_else_rev() { } fn match_arm() { - let _x = match Ok(UnitDefault::default()) { + let _x: () = match Ok(UnitDefault::default()) { Ok(v) => v, Err(()) => return, }; } fn match_arm_rev() { - let _x = match Ok(UnitDefault::default()) { + let _x: () = match Ok(UnitDefault::default()) { Err(()) => return, Ok(v) => v, }; } fn loop_break() { - let _x = loop { + let _x: () = loop { if false { break return; } else { @@ -88,7 +88,7 @@ fn loop_break() { } fn loop_break_rev() { - let _x = loop { + let _x: () = loop { if false { break return; } else { diff --git a/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr b/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr index 3215c4669..df29fe227 100644 --- a/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr +++ b/tests/ui/never_type/diverging-fallback-no-leak.fallback.stderr @@ -7,8 +7,8 @@ LL | unconstrained_arg(return); | required by a bound introduced by this call | = help: the following other types implement trait `Test`: - () i32 + () = 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) = help: did you intend to use the type `()` here instead? note: required by a bound in `unconstrained_arg` diff --git a/tests/ui/never_type/issue-13352.stderr b/tests/ui/never_type/issue-13352.stderr index 2d22da0b4..406785bfe 100644 --- a/tests/ui/never_type/issue-13352.stderr +++ b/tests/ui/never_type/issue-13352.stderr @@ -6,10 +6,10 @@ LL | 2_usize + (loop {}); | = help: the trait `Add<()>` is not implemented for `usize` = help: the following other types implement trait `Add<Rhs>`: + <usize as Add> + <usize as Add<&usize>> <&'a usize as Add<usize>> <&usize as Add<&usize>> - <usize as Add<&usize>> - <usize as Add> error: aborting due to previous error |