]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_span/src/hygiene.rs
fix most compiler/ doctests
[rust.git] / compiler / rustc_span / src / hygiene.rs
index 3889639b50f454bf232b430c17bbf9ff86397db1..687d7471b25b2f9212b82b8aa165f4f01304e7b2 100644 (file)
@@ -686,7 +686,7 @@ pub const fn root() -> Self {
     /// context up one macro definition level. That is, if we have a nested macro
     /// definition as follows:
     ///
-    /// ```rust
+    /// ```ignore (illustrative)
     /// macro_rules! f {
     ///    macro_rules! g {
     ///        ...
@@ -710,6 +710,7 @@ pub fn marks(self) -> Vec<(ExpnId, Transparency)> {
     /// For example, consider the following three resolutions of `f`:
     ///
     /// ```rust
+    /// #![feature(decl_macro)]
     /// mod foo { pub fn f() {} } // `f`'s `SyntaxContext` is empty.
     /// m!(f);
     /// macro m($f:ident) {
@@ -746,7 +747,8 @@ pub fn normalize_to_macros_2_0_and_adjust(&mut self, expn_id: ExpnId) -> Option<
     /// via a glob import with the given `SyntaxContext`.
     /// For example:
     ///
-    /// ```rust
+    /// ```compile_fail,E0425
+    /// #![feature(decl_macro)]
     /// m!(f);
     /// macro m($i:ident) {
     ///     mod foo {
@@ -786,7 +788,7 @@ pub fn glob_adjust(&mut self, expn_id: ExpnId, glob_span: Span) -> Option<Option
 
     /// Undo `glob_adjust` if possible:
     ///
-    /// ```rust
+    /// ```ignore (illustrative)
     /// if let Some(privacy_checking_scope) = self.reverse_glob_adjust(expansion, glob_ctxt) {
     ///     assert!(self.glob_adjust(expansion, glob_ctxt) == Some(privacy_checking_scope));
     /// }