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) {
|
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {
|
||||||
Ok(p) => p,
|
Ok(p) => p,
|
||||||
Err(errs) => {
|
Err(errs) => {
|
||||||
for mut err in errs {
|
drop(errs);
|
||||||
err.cancel();
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -668,7 +666,7 @@ fn has_needless_main(code: String, edition: Edition) -> bool {
|
|||||||
_ => {},
|
_ => {},
|
||||||
},
|
},
|
||||||
Ok(None) => break,
|
Ok(None) => break,
|
||||||
Err(mut e) => {
|
Err(e) => {
|
||||||
e.cancel();
|
e.cancel();
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
@ -534,7 +534,7 @@ fn check_tts<'a>(&self, cx: &EarlyContext<'a>, tts: TokenStream, is_write: bool)
|
|||||||
match parser
|
match parser
|
||||||
.parse_expr()
|
.parse_expr()
|
||||||
.map(rustc_ast::ptr::P::into_inner)
|
.map(rustc_ast::ptr::P::into_inner)
|
||||||
.map_err(|mut e| e.cancel())
|
.map_err(|e| e.cancel())
|
||||||
{
|
{
|
||||||
// write!(e, ...)
|
// write!(e, ...)
|
||||||
Ok(p) if parser.eat(&token::Comma) => Some(p),
|
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 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
|
expr
|
||||||
} else {
|
} else {
|
||||||
return (Some(fmtstr), None);
|
return (Some(fmtstr), None);
|
||||||
|
Loading…
Reference in New Issue
Block a user