Do not suggest using ! with break
This commit is contained in:
parent
c076392143
commit
799b13ada5
2 changed files with 2 additions and 4 deletions
|
|
@ -559,6 +559,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
ty::Char => "'a'",
|
||||
ty::Int(_) | ty::Uint(_) => "42",
|
||||
ty::Float(_) => "3.14159",
|
||||
ty::Error | ty::Never => return,
|
||||
_ => "value",
|
||||
});
|
||||
err.span_suggestion(expr.span, msg, sugg, Applicability::HasPlaceholders);
|
||||
|
|
|
|||
|
|
@ -90,10 +90,7 @@ error[E0308]: mismatched types
|
|||
--> $DIR/loop-break-value.rs:4:31
|
||||
|
|
||||
LL | let val: ! = loop { break break; };
|
||||
| ^^^^^
|
||||
| |
|
||||
| expected !, found ()
|
||||
| help: give it a value of the expected type: `break value`
|
||||
| ^^^^^ expected !, found ()
|
||||
|
|
||||
= note: expected type `!`
|
||||
found type `()`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue