]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax_pos/lib.rs
Stabilize proc macros generating `macro_rules` items
[rust.git] / src / libsyntax_pos / lib.rs
index 6e83e1d3f8d4fc178c422b91ae42f461d4a5a905..7f7c5cb2e454865aa188616c11958410f98fe3b9 100644 (file)
@@ -12,7 +12,7 @@
 #![feature(non_exhaustive)]
 #![feature(optin_builtin_traits)]
 #![feature(rustc_attrs)]
-#![feature(proc_macro_hygiene)]
+#![cfg_attr(bootstrap, feature(proc_macro_hygiene))]
 #![feature(specialization)]
 #![feature(step_trait)]
 
@@ -526,6 +526,12 @@ pub fn with_call_site_ctxt(&self, expn_id: ExpnId) -> Span {
         self.with_ctxt_from_mark(expn_id, Transparency::Transparent)
     }
 
+    /// Equivalent of `Span::mixed_site` from the proc macro API,
+    /// except that the location is taken from the `self` span.
+    pub fn with_mixed_site_ctxt(&self, expn_id: ExpnId) -> Span {
+        self.with_ctxt_from_mark(expn_id, Transparency::SemiTransparent)
+    }
+
     /// Produces a span with the same location as `self` and context produced by a macro with the
     /// given ID and transparency, assuming that macro was defined directly and not produced by
     /// some other macro (which is the case for built-in and procedural macros).