about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoralexey zabelin <zabelin.alex@gmail.com>2017-04-13 09:53:22 -0400
committeralexey zabelin <zabelin.alex@gmail.com>2017-04-13 09:53:22 -0400
commit14eac29753efd5a5e8ded83a2c8ae8e44e914320 (patch)
treec3aa0f50b097de1d8ee7ccc7228d723fd003210f /src
parenta50737051abdc943f96c6e89a732fd00e58248e8 (diff)
downloadrust-14eac29753efd5a5e8ded83a2c8ae8e44e914320.tar.gz
rust-14eac29753efd5a5e8ded83a2c8ae8e44e914320.zip
Address the PR review
Diffstat (limited to 'src')
-rw-r--r--src/doc/grammar.md3
-rw-r--r--src/libsyntax/parse/parser.rs4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/doc/grammar.md b/src/doc/grammar.md
index 239afd41f02..3fbf9f06d99 100644
--- a/src/doc/grammar.md
+++ b/src/doc/grammar.md
@@ -761,8 +761,6 @@ closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
                 [ ':' bound-list ] [ '->' type ]
 lifetime-list := lifetime | lifetime ',' lifetime-list
 arg-list := ident ':' type | ident ':' type ',' arg-list
-bound-list := bound | bound '+' bound-list
-bound := path | lifetime
 ```
 
 ### Never type
@@ -786,6 +784,7 @@ never_type : "!" ;
 bound := ty_bound | lt_bound
 lt_bound := lifetime
 ty_bound := [?] [ for<lt_param_defs> ] simple_path
+bound-list := bound | bound '+' bound-list '+' ?
 ```
 
 ### Self types
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 5cacb0da9e5..0fddbca72cd 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`.
+    // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
     // BOUND = TY_BOUND | LT_BOUND
     // LT_BOUND = LIFETIME (e.g. `'a`)
     // TY_BOUND = [?] [for<LT_PARAM_DEFS>] 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`.
+    // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
     // BOUND = LT_BOUND (e.g. `'a`)
     fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
         let mut lifetimes = Vec::new();