mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
parser::attr: remove .fatal calls
This commit is contained in:
@@ -46,7 +46,8 @@ pub(super) fn parse_outer_attributes(&mut self) -> PResult<'a, Vec<ast::Attribut
|
||||
token::DocComment(s) => {
|
||||
let attr = self.mk_doc_comment(s);
|
||||
if attr.style != ast::AttrStyle::Outer {
|
||||
let mut err = self.fatal("expected outer doc comment");
|
||||
let span = self.token.span;
|
||||
let mut err = self.struct_span_err(span, "expected outer doc comment");
|
||||
err.note(
|
||||
"inner doc comments like this (starting with \
|
||||
`//!` or `/*!`) can only appear before items",
|
||||
@@ -156,7 +157,8 @@ fn parse_attribute_with_inner_parse_policy(
|
||||
}
|
||||
_ => {
|
||||
let token_str = pprust::token_to_string(&self.token);
|
||||
return Err(self.fatal(&format!("expected `#`, found `{}`", token_str)));
|
||||
let msg = &format!("expected `#`, found `{}`", token_str);
|
||||
return Err(self.struct_span_err(self.token.span, msg));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user