Skip to content

Commit 011f240

Browse files
committed
Auto merge of #41264 - alexeyzab:41158-fix-docs, r=steveklabnik
Fix old docs Fixes #41158
2 parents 5997806 + 08a955a commit 011f240

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/doc/grammar.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,6 @@ closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
761761
[ ':' bound-list ] [ '->' type ]
762762
lifetime-list := lifetime | lifetime ',' lifetime-list
763763
arg-list := ident ':' type | ident ':' type ',' arg-list
764-
bound-list := bound | bound '+' bound-list
765-
bound := path | lifetime
766764
```
767765

768766
### Never type
@@ -780,6 +778,15 @@ never_type : "!" ;
780778

781779
**FIXME:** grammar?
782780

781+
### Type parameter bounds
782+
783+
```antlr
784+
bound := ty_bound | lt_bound
785+
lt_bound := lifetime
786+
ty_bound := [?] [ for<lt_param_defs> ] simple_path
787+
bound-list := bound | bound '+' bound-list '+' ?
788+
```
789+
783790
### Self types
784791

785792
**FIXME:** grammar?

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> {
40664066
}).emit();
40674067
}
40684068

4069-
// Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
4069+
// Parse bounds of a type parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
40704070
// BOUND = TY_BOUND | LT_BOUND
40714071
// LT_BOUND = LIFETIME (e.g. `'a`)
40724072
// TY_BOUND = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
@@ -4107,7 +4107,7 @@ impl<'a> Parser<'a> {
41074107
self.parse_ty_param_bounds_common(true)
41084108
}
41094109

4110-
// Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
4110+
// Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
41114111
// BOUND = LT_BOUND (e.g. `'a`)
41124112
fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
41134113
let mut lifetimes = Vec::new();

0 commit comments

Comments
 (0)