]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/item.rs
fix most compiler/ doctests
[rust.git] / compiler / rustc_parse / src / parser / item.rs
index 10f1daf11295107540cd1d6d180741c3db06c49d..56757c1d903518780c5d0f7ccee9994912f54c8f 100644 (file)
@@ -485,7 +485,7 @@ fn parse_polarity(&mut self) -> ast::ImplPolarity {
 
     /// Parses an implementation item.
     ///
-    /// ```
+    /// ```ignore (illustrative)
     /// impl<'a, T> TYPE { /* impl items */ }
     /// impl<'a, T> TRAIT for TYPE { /* impl items */ }
     /// impl<'a, T> !TRAIT for TYPE { /* impl items */ }
@@ -493,7 +493,7 @@ fn parse_polarity(&mut self) -> ast::ImplPolarity {
     /// ```
     ///
     /// We actually parse slightly more relaxed grammar for better error reporting and recovery.
-    /// ```
+    /// ```ebnf
     /// "impl" GENERICS "const"? "!"? TYPE "for"? (TYPE | "..") ("where" PREDICATES)? "{" BODY "}"
     /// "impl" GENERICS "const"? "!"? TYPE ("where" PREDICATES)? "{" BODY "}"
     /// ```
@@ -806,7 +806,7 @@ fn parse_assoc_item(
     }
 
     /// Parses a `type` alias with the following grammar:
-    /// ```
+    /// ```ebnf
     /// TypeAlias = "type" Ident Generics {":" GenericBounds}? {"=" Ty}? ";" ;
     /// ```
     /// The `"type"` has already been eaten.
@@ -930,7 +930,7 @@ fn parse_ident_or_underscore(&mut self) -> PResult<'a, Ident> {
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```ignore (illustrative)
     /// extern crate foo;
     /// extern crate bar as foo;
     /// ```
@@ -1630,7 +1630,7 @@ fn parse_field_ident(&mut self, adt_ty: &str, lo: Span) -> PResult<'a, Ident> {
 
     /// Parses a declarative macro 2.0 definition.
     /// The `macro` keyword has already been parsed.
-    /// ```
+    /// ```ebnf
     /// MacBody = "{" TOKEN_STREAM "}" ;
     /// MacParams = "(" TOKEN_STREAM ")" ;
     /// DeclMac = "macro" Ident MacParams? MacBody ;