Extended elaboration for trait aliases to include arbitrary bounds.

This commit is contained in:
Alexander Regueiro
2018-10-26 23:13:12 +01:00
parent a8fcfcef30
commit 4bdc3d833a
11 changed files with 57 additions and 59 deletions

View File

@@ -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> {
/*
@@ -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 ";"