1
Fork 0

rustc_error: make ErrorReported impossible to construct

There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.
This commit is contained in:
mark 2022-01-22 18:49:12 -06:00
parent 461e807801
commit bb8d4307eb
104 changed files with 705 additions and 550 deletions

View file

@ -180,13 +180,13 @@ impl EarlyLintPass for NonAsciiIdents {
}
has_non_ascii_idents = true;
cx.struct_span_lint(NON_ASCII_IDENTS, sp, |lint| {
lint.build("identifier contains non-ASCII characters").emit()
lint.build("identifier contains non-ASCII characters").emit();
});
if check_uncommon_codepoints
&& !symbol_str.chars().all(GeneralSecurityProfile::identifier_allowed)
{
cx.struct_span_lint(UNCOMMON_CODEPOINTS, sp, |lint| {
lint.build("identifier contains uncommon Unicode codepoints").emit()
lint.build("identifier contains uncommon Unicode codepoints").emit();
})
}
}
@ -337,7 +337,7 @@ impl EarlyLintPass for NonAsciiIdents {
let char_info = format!("'{}' (U+{:04X})", ch, ch as u32);
note += &char_info;
}
lint.build(&message).note(&note).note("please recheck to make sure their usages are indeed what you want").emit()
lint.build(&message).note(&note).note("please recheck to make sure their usages are indeed what you want").emit();
});
}
}