From a50737051abdc943f96c6e89a732fd00e58248e8 Mon Sep 17 00:00:00 2001 From: alexey zabelin Date: Wed, 12 Apr 2017 20:46:44 -0400 Subject: [PATCH] Fix old docs #41158 --- src/doc/grammar.md | 8 ++++++++ src/libsyntax/parse/parser.rs | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/doc/grammar.md b/src/doc/grammar.md index 8e803aff4d6..239afd41f02 100644 --- a/src/doc/grammar.md +++ b/src/doc/grammar.md @@ -780,6 +780,14 @@ never_type : "!" ; **FIXME:** grammar? +### Type parameter bounds + +```antlr +bound := ty_bound | lt_bound +lt_bound := lifetime +ty_bound := [?] [ for ] simple_path +``` + ### Self types **FIXME:** grammar? diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 3b928ea93c7..5cacb0da9e5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> { }).emit(); } - // Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`. + // Parse bounds of a type parameter `BOUND + BOUND + BOUND`. // BOUND = TY_BOUND | LT_BOUND // LT_BOUND = LIFETIME (e.g. `'a`) // TY_BOUND = [?] [for] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`) @@ -4107,7 +4107,7 @@ impl<'a> Parser<'a> { self.parse_ty_param_bounds_common(true) } - // Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`. + // Parse bounds of a type parameter `BOUND + BOUND + BOUND`. // BOUND = LT_BOUND (e.g. `'a`) fn parse_lt_param_bounds(&mut self) -> Vec { let mut lifetimes = Vec::new();