Rollup merge of #35351 - jaredwy:update-error-69, r=jonathandturner
Updated error format for E0069 Fixes #35219 which is part of the error bonanza at #35233 r? @jonathandturner
This commit is contained in:
commit
8e1b96a690
@ -3406,8 +3406,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
||||
// FIXME(#32730) propagate obligations
|
||||
.map(|InferOk { obligations, .. }| assert!(obligations.is_empty()));
|
||||
if eq_result.is_err() {
|
||||
span_err!(tcx.sess, expr.span, E0069,
|
||||
"`return;` in a function whose return type is not `()`");
|
||||
struct_span_err!(tcx.sess, expr.span, E0069,
|
||||
"`return;` in a function whose return type is not `()`")
|
||||
.span_label(expr.span, &format!("return type is not ()"))
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
// except according to those terms.
|
||||
|
||||
fn foo() -> u8 {
|
||||
return; //~ ERROR E0069
|
||||
return;
|
||||
//~^ ERROR `return;` in a function whose return type is not `()`
|
||||
//~| NOTE return type is not ()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user