diff options
| author | bors <bors@rust-lang.org> | 2017-10-24 01:20:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-10-24 01:20:09 +0000 |
| commit | 336624735c696fe3c15b64db83f19e9ce4665d06 (patch) | |
| tree | 2f141291475025b0200376e3695fc7e3c4d372b7 /src/libsyntax/ext | |
| parent | 4c053db233d69519b548e5b8ed7192d0783e582a (diff) | |
| parent | 4b0f004e3ddd4421153fd3a0a85343652aa864ce (diff) | |
| download | rust-336624735c696fe3c15b64db83f19e9ce4665d06.tar.gz rust-336624735c696fe3c15b64db83f19e9ce4665d06.zip | |
Auto merge of #44766 - sunjay:lift_generics, r=nikomatsakis
Move Generics from MethodSig to TraitItem and ImplItem As part of `rust-impl-period/WG-compiler-traits`, we want to "lift" `Generics` from `MethodSig` into `TraitItem` and `ImplItem`. This is in preparation for adding associated type generics. (https://github.com/rust-lang/rust/issues/44265#issuecomment-331172238) Currently this change is only made in the AST. In the future, it may also impact the HIR. (Still discussing) To understand this PR, it's probably best to start from the changes to `ast.rs` and then work your way to the other files to understand the far reaching effects of this change. r? @nikomatsakis
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/placeholders.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/placeholders.rs b/src/libsyntax/ext/placeholders.rs index 4fc2b92d3cd..2f5b386346b 100644 --- a/src/libsyntax/ext/placeholders.rs +++ b/src/libsyntax/ext/placeholders.rs @@ -32,6 +32,7 @@ pub fn placeholder(kind: ExpansionKind, id: ast::NodeId) -> Expansion { let ident = keywords::Invalid.ident(); let attrs = Vec::new(); + let generics = ast::Generics::default(); let vis = ast::Visibility::Inherited; let span = DUMMY_SP; let expr_placeholder = || P(ast::Expr { @@ -49,12 +50,12 @@ pub fn placeholder(kind: ExpansionKind, id: ast::NodeId) -> Expansion { tokens: None, }))), ExpansionKind::TraitItems => Expansion::TraitItems(SmallVector::one(ast::TraitItem { - id, span, ident, attrs, + id, span, ident, attrs, generics, node: ast::TraitItemKind::Macro(mac_placeholder()), tokens: None, })), ExpansionKind::ImplItems => Expansion::ImplItems(SmallVector::one(ast::ImplItem { - id, span, ident, vis, attrs, + id, span, ident, vis, attrs, generics, node: ast::ImplItemKind::Macro(mac_placeholder()), defaultness: ast::Defaultness::Final, tokens: None, |
