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:
Mazdak Farrokhzad 2019-12-05 19:03:15 +01:00 committed by GitHub
commit 8e6cf861e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 61 additions and 8 deletions

View file

@ -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