Do not abort compilation if expansion produces errors

Fix a number of uncovered deficiencies in diagnostics
This commit is contained in:
Vadim Petrochenkov
2018-12-16 20:23:27 +03:00
parent a5c52c72ae
commit fff01ccfa8
80 changed files with 543 additions and 172 deletions

View File

@@ -666,7 +666,7 @@ impl<'a, 'b> Context<'a, 'b> {
"X" => "UpperHex",
_ => {
ecx.span_err(sp, &format!("unknown format trait `{}`", *tyname));
"Dummy"
return DummyResult::raw_expr(sp);
}
}
}
@@ -713,7 +713,7 @@ pub fn expand_format_args_nl<'cx>(
sp,
feature_gate::GateIssue::Language,
feature_gate::EXPLAIN_FORMAT_ARGS_NL);
return base::DummyResult::expr(sp);
return DummyResult::expr(sp);
}
sp = sp.apply_mark(ecx.current_expansion.mark);
match parse_args(ecx, sp, tts) {