diff options
| author | bors <bors@rust-lang.org> | 2018-11-03 17:30:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-11-03 17:30:37 +0000 |
| commit | a3f0f5107e48d47936a604325a1af325033901d0 (patch) | |
| tree | 53f0ad160be90667d55a84b30817060bd6a7678d /src/libsyntax/parse/parser.rs | |
| parent | 3d28ee3e34d100534062d0bc690779ed9b6927fe (diff) | |
| parent | 417168587beda80b97e9de83b61cbb8517a61dbc (diff) | |
| download | rust-a3f0f5107e48d47936a604325a1af325033901d0.tar.gz rust-a3f0f5107e48d47936a604325a1af325033901d0.zip | |
Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakis
Implement trait aliases (RFC 1733) Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733. CC @durka @nikomatsakis
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index be448f960df..d3416d6923c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1295,7 +1295,7 @@ impl<'a> Parser<'a> { self.check_keyword(keywords::Extern) && self.is_extern_non_path() } - /// parse a TyKind::BareFn type: + /// parse a `TyKind::BareFn` type: fn parse_ty_bare_fn(&mut self, generic_params: Vec<GenericParam>) -> PResult<'a, TyKind> { /* @@ -1532,7 +1532,7 @@ impl<'a> Parser<'a> { if maybe_bounds && bounds.len() == 1 && !trailing_plus => { let path = match bounds[0] { GenericBound::Trait(ref pt, ..) => pt.trait_ref.path.clone(), - _ => self.bug("unexpected lifetime bound"), + GenericBound::Outlives(..) => self.bug("unexpected lifetime bound"), }; self.parse_remaining_bounds(Vec::new(), path, lo, true)? } @@ -5779,7 +5779,7 @@ impl<'a> Parser<'a> { ast::ImplItemKind)> { // code copied from parse_macro_use_or_failure... abstraction! if let Some(mac) = self.parse_assoc_macro_invoc("impl", Some(vis), at_end)? { - // Method macro. + // method macro Ok((keywords::Invalid.ident(), vec![], ast::Generics::default(), ast::ImplItemKind::Macro(mac))) } else { @@ -6792,11 +6792,11 @@ impl<'a> Parser<'a> { Ok(self.mk_item(lo.to(prev_span), invalid, ItemKind::ForeignMod(m), visibility, attrs)) } - /// Parse type Foo = Bar; + /// Parse `type Foo = Bar;` /// or - /// existential type Foo: Bar; + /// `existential type Foo: Bar;` /// or - /// return None without modifying the parser state + /// `return None` without modifying the parser state fn eat_type(&mut self) -> Option<PResult<'a, (Ident, AliasKind, ast::Generics)>> { // This parses the grammar: // Ident ["<"...">"] ["where" ...] ("=" | ":") Ty ";" |
