From: Mazdak Farrokhzad Date: Sun, 8 Dec 2019 08:08:19 +0000 (+0100) Subject: parse_ty_common: .fatal -> .struct_span_err X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=3b1fab8c1f0ef78d90fd27d8ec0e6950c050d259;p=rust.git parse_ty_common: .fatal -> .struct_span_err --- diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs index 840461d75be..d9938a81240 100644 --- a/src/librustc_parse/parser/ty.rs +++ b/src/librustc_parse/parser/ty.rs @@ -133,7 +133,7 @@ fn parse_ty_common( } } else { let msg = format!("expected type, found {}", self.this_token_descr()); - let mut err = self.fatal(&msg); + let mut err = self.struct_span_err(self.token.span, &msg); err.span_label(self.token.span, "expected type"); self.maybe_annotate_with_ascription(&mut err, true); return Err(err); diff --git a/src/test/ui/type/ascription/issue-47666.stderr b/src/test/ui/type/ascription/issue-47666.stderr index 2f052341fae..648635f0c32 100644 --- a/src/test/ui/type/ascription/issue-47666.stderr +++ b/src/test/ui/type/ascription/issue-47666.stderr @@ -11,7 +11,7 @@ LL | let _ = Option:Some(vec![0, 1]); | = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` = note: for more information, see https://github.com/rust-lang/rust/issues/23416 - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error