X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_parse%2Fsrc%2Fparser%2Fty.rs;h=b0439a5987afa6dd37fc08256932d4005b019053;hb=7907385999b4a83d37ed31d334f3ed9ca02983a1;hp=9e771a8af1a4e0a3368b4c4b5a7409fa05fafa00;hpb=48199e0e3fb3f77bfa5befc2bc485280ad922f53;p=rust.git diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 9e771a8af1a..b0439a5987a 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -52,7 +52,7 @@ pub(super) enum RecoverQuestionMark { /// Signals whether parsing a type should recover `->`. /// /// More specifically, when parsing a function like: -/// ```rust +/// ```compile_fail /// fn foo() => u8 { 0 } /// fn bar(): u8 { 0 } /// ``` @@ -499,12 +499,12 @@ fn parse_typeof_ty(&mut self) -> PResult<'a, TyKind> { } /// Parses a function pointer type (`TyKind::BareFn`). - /// ``` - /// [unsafe] [extern "ABI"] fn (S) -> T - /// ^~~~~^ ^~~~^ ^~^ ^ - /// | | | | - /// | | | Return type - /// Function Style ABI Parameter types + /// ```ignore (illustrative) + /// [unsafe] [extern "ABI"] fn (S) -> T + /// // ^~~~~^ ^~~~^ ^~^ ^ + /// // | | | | + /// // | | | Return type + /// // Function Style ABI Parameter types /// ``` /// We actually parse `FnHeader FnDecl`, but we error on `const` and `async` qualifiers. fn parse_ty_bare_fn( @@ -707,7 +707,7 @@ fn error_negative_bounds( } /// Parses a bound according to the grammar: - /// ``` + /// ```ebnf /// BOUND = TY_BOUND | LT_BOUND /// ``` fn parse_generic_bound(&mut self) -> PResult<'a, Result> { @@ -729,7 +729,7 @@ fn parse_generic_bound(&mut self) -> PResult<'a, Result> { } /// Parses a lifetime ("outlives") bound, e.g. `'a`, according to: - /// ``` + /// ```ebnf /// LT_BOUND = LIFETIME /// ``` fn parse_generic_lt_bound( @@ -787,7 +787,7 @@ fn recover_paren_lifetime(&mut self, lo: Span, inner_lo: Span) -> PResult<'a, () /// /// If no modifiers are present, this does not consume any tokens. /// - /// ``` + /// ```ebnf /// TY_BOUND_MODIFIERS = ["~const"] ["?"] /// ``` fn parse_ty_bound_modifiers(&mut self) -> PResult<'a, BoundModifiers> { @@ -807,7 +807,7 @@ fn parse_ty_bound_modifiers(&mut self) -> PResult<'a, BoundModifiers> { } /// Parses a type bound according to: - /// ``` + /// ```ebnf /// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN) /// TY_BOUND_NOPAREN = [TY_BOUND_MODIFIERS] [for] SIMPLE_PATH /// ```