From f97c132cac79ef6bdf9f950b415c67bb43af387a Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Sun, 30 Oct 2016 03:42:12 +0300 Subject: rustc: use Span's allow_internal_unstable instead of hir::BlockCheckMode. --- src/libsyntax/codemap.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 3cdfa718eab..12ce6428911 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -51,6 +51,8 @@ pub enum ExpnFormat { MacroAttribute(Name), /// e.g. `format!()` MacroBang(Name), + /// Desugaring done by the compiler during HIR lowering. + CompilerDesugaring(Name) } #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] @@ -105,8 +107,9 @@ pub struct NameAndSpan { impl NameAndSpan { pub fn name(&self) -> Name { match self.format { - ExpnFormat::MacroAttribute(s) => s, - ExpnFormat::MacroBang(s) => s, + ExpnFormat::MacroAttribute(s) | + ExpnFormat::MacroBang(s) | + ExpnFormat::CompilerDesugaring(s) => s, } } } @@ -813,6 +816,7 @@ impl CodeMap { let (pre, post) = match ei.callee.format { MacroAttribute(..) => ("#[", "]"), MacroBang(..) => ("", "!"), + CompilerDesugaring(..) => ("desugaring of `", "`"), }; let macro_decl_name = format!("{}{}{}", pre, -- cgit 1.4.1-3-g733a5