Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix old docs #41264

Merged
merged 3 commits into from
Apr 17, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,14 @@ never_type : "!" ;

**FIXME:** grammar?

### Type parameter bounds

```antlr
bound := ty_bound | lt_bound
lt_bound := lifetime
ty_bound := [?] [ for<lt_param_defs> ] simple_path
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also remove the bound grammar from ### Closure types and move the bound-list grammar into this paragraph (adjusting it with optional trailing +).

### Self types

**FIXME:** grammar?
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
Expand Down Expand Up @@ -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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type parameter -> lifetime parameter

I'd also write "possibly with trailing +" to avoid future questions for sure.

// BOUND = LT_BOUND (e.g. `'a`)
fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
let mut lifetimes = Vec::new();
Expand Down