Rollup merge of #67010 - estebank:raw-idents, r=Centril
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix #65634.
This commit is contained in:
commit
8e6cf861e5
9 changed files with 61 additions and 8 deletions
|
|
@ -1282,6 +1282,9 @@ impl<F: fmt::Write> Printer<'tcx> for FmtPrinter<'_, 'tcx, F> {
|
|||
if !self.empty_path {
|
||||
write!(self, "::")?;
|
||||
}
|
||||
if ast::Ident::from_str(&name).is_raw_guess() {
|
||||
write!(self, "r#")?;
|
||||
}
|
||||
write!(self, "{}", name)?;
|
||||
|
||||
// FIXME(eddyb) this will print e.g. `{{closure}}#3`, but it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue