about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-08 06:02:54 +0000
committerbors <bors@rust-lang.org>2019-12-08 06:02:54 +0000
commite862c01aadb2d029864f7bb256cf6c85bbb5d7e4 (patch)
treed1c98f5b876a0d8f092f7003cab372b5dbe00f16 /src/libsyntax
parentde17464b14e503edca6625daa9cd4c338ffafee2 (diff)
parent32e27c2c9a11e47289ac36101f583e08e8bc6f5e (diff)
downloadrust-e862c01aadb2d029864f7bb256cf6c85bbb5d7e4.tar.gz
rust-e862c01aadb2d029864f7bb256cf6c85bbb5d7e4.zip
Auto merge of #67140 - Centril:rollup-h7rbw7y, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #66325 (Change unused_labels from allow to warn)
 - #66991 (Cleanup BodyCache)
 - #67101 (use `#[allow(unused_attributes)]` to paper over incr.comp problem)
 - #67114 (Make `ForeignItem` an alias of `Item`.)
 - #67129 (Fixes typo)

Failed merges:

 - #66886 (Remove the borrow check::nll submodule)

r? @ghost
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs15
-rw-r--r--src/libsyntax/mut_visit.rs2
2 files changed, 4 insertions, 13 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 75ddf10514d..92ba071a03d 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -2488,14 +2488,14 @@ impl VariantData {
 ///
 /// The name might be a dummy name in case of anonymous items.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
-pub struct Item {
+pub struct Item<K = ItemKind> {
     pub attrs: Vec<Attribute>,
     pub id: NodeId,
     pub span: Span,
     pub vis: Visibility,
     pub ident: Ident,
 
-    pub kind: ItemKind,
+    pub kind: K,
 
     /// Original tokens this item was parsed from. This isn't necessarily
     /// available for all items, although over time more and more items should
@@ -2650,16 +2650,7 @@ impl ItemKind {
     }
 }
 
-#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
-pub struct ForeignItem {
-    pub attrs: Vec<Attribute>,
-    pub id: NodeId,
-    pub span: Span,
-    pub vis: Visibility,
-    pub ident: Ident,
-
-    pub kind: ForeignItemKind,
-}
+pub type ForeignItem = Item<ForeignItemKind>;
 
 /// An item within an `extern` block.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs
index 8889e5df26c..f8795d885d2 100644
--- a/src/libsyntax/mut_visit.rs
+++ b/src/libsyntax/mut_visit.rs
@@ -1053,7 +1053,7 @@ pub fn noop_flat_map_item<T: MutVisitor>(mut item: P<Item>, visitor: &mut T)
 pub fn noop_flat_map_foreign_item<T: MutVisitor>(mut item: ForeignItem, visitor: &mut T)
     -> SmallVec<[ForeignItem; 1]>
 {
-    let ForeignItem { ident, attrs, kind, id, span, vis } = &mut item;
+    let ForeignItem { ident, attrs, id, kind, vis, span, tokens: _ } = &mut item;
     visitor.visit_ident(ident);
     visit_attrs(attrs, visitor);
     match kind {