rustc_errors: take self
by value in DiagnosticBuilder::cancel
.
This commit is contained in:
parent
88483bd4b7
commit
881b8cb704
@ -628,9 +628,7 @@ fn has_needless_main(code: String, edition: Edition) -> bool {
|
||||
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {
|
||||
Ok(p) => p,
|
||||
Err(errs) => {
|
||||
for mut err in errs {
|
||||
err.cancel();
|
||||
}
|
||||
drop(errs);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
@ -668,7 +666,7 @@ fn has_needless_main(code: String, edition: Edition) -> bool {
|
||||
_ => {},
|
||||
},
|
||||
Ok(None) => break,
|
||||
Err(mut e) => {
|
||||
Err(e) => {
|
||||
e.cancel();
|
||||
return false;
|
||||
},
|
||||
|
@ -534,7 +534,7 @@ fn check_tts<'a>(&self, cx: &EarlyContext<'a>, tts: TokenStream, is_write: bool)
|
||||
match parser
|
||||
.parse_expr()
|
||||
.map(rustc_ast::ptr::P::into_inner)
|
||||
.map_err(|mut e| e.cancel())
|
||||
.map_err(|e| e.cancel())
|
||||
{
|
||||
// write!(e, ...)
|
||||
Ok(p) if parser.eat(&token::Comma) => Some(p),
|
||||
@ -563,7 +563,7 @@ fn check_tts<'a>(&self, cx: &EarlyContext<'a>, tts: TokenStream, is_write: bool)
|
||||
}
|
||||
|
||||
let comma_span = parser.prev_token.span;
|
||||
let token_expr = if let Ok(expr) = parser.parse_expr().map_err(|mut err| err.cancel()) {
|
||||
let token_expr = if let Ok(expr) = parser.parse_expr().map_err(|err| err.cancel()) {
|
||||
expr
|
||||
} else {
|
||||
return (Some(fmtstr), None);
|
||||
|
Loading…
Reference in New Issue
Block a user