Remove DiagnosticBuilder::delay_as_bug_without_consuming.
The existing uses are replaced in one of three ways. - In a function that also has calls to `emit`, just rearrange the code so that exactly one of `delay_as_bug` or `emit` is called on every path. - In a function returning a `DiagnosticBuilder`, use `downgrade_to_delayed_bug`. That's good enough because it will get emitted later anyway. - In `unclosed_delim_err`, one set of errors is being replaced with another set, so just cancel the original errors.
This commit is contained in:
@@ -67,7 +67,7 @@ pub(crate) fn parse_token_trees<'a>(
|
||||
let (stream, res, unmatched_delims) =
|
||||
tokentrees::TokenTreesReader::parse_all_token_trees(string_reader);
|
||||
match res {
|
||||
Ok(_open_spacing) if unmatched_delims.is_empty() => Ok(stream),
|
||||
Ok(()) if unmatched_delims.is_empty() => Ok(stream),
|
||||
_ => {
|
||||
// Return error if there are unmatched delimiters or unclosed delimiters.
|
||||
// We emit delimiter mismatch errors first, then emit the unclosing delimiter mismatch
|
||||
|
||||
Reference in New Issue
Block a user