diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-10-08 23:45:46 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-10-13 15:19:25 +0300 |
| commit | 40aa09e4c9f4c3f0fa2b088895c8f5125325eaa4 (patch) | |
| tree | 0ea29987683fbd21b30e2bc23769517a7984a116 /src/librustc/metadata | |
| parent | 30af54dede8b9f03a83dd5ad588bb430a5a76270 (diff) | |
| download | rust-40aa09e4c9f4c3f0fa2b088895c8f5125325eaa4.tar.gz rust-40aa09e4c9f4c3f0fa2b088895c8f5125325eaa4.zip | |
Merge struct fields and struct kind
Diffstat (limited to 'src/librustc/metadata')
| -rw-r--r-- | src/librustc/metadata/encoder.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 2bee3f296c9..81305099705 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -381,7 +381,7 @@ fn each_auxiliary_node_id<F>(item: &hir::Item, callback: F) -> bool where match item.node { hir::ItemStruct(ref struct_def, _) => { // If this is a newtype struct, return the constructor. - if struct_def.kind == hir::VariantKind::Tuple { + if struct_def.is_tuple() { continue_ = callback(struct_def.id); } } @@ -1068,7 +1068,7 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>, // Encode inherent implementations for this structure. encode_inherent_implementations(ecx, rbml_w, def_id); - if struct_def.kind != hir::VariantKind::Struct { + if !struct_def.is_struct() { let ctor_did = ecx.tcx.map.local_def_id(struct_def.id); rbml_w.wr_tagged_u64(tag_items_data_item_struct_ctor, def_to_u64(ctor_did)); @@ -1081,7 +1081,7 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>, } // If this is a tuple-like struct, encode the type of the constructor. - if struct_def.kind != hir::VariantKind::Struct { + if !struct_def.is_struct() { encode_info_for_struct_ctor(ecx, rbml_w, item.name, struct_def.id, index, item.id); } } |
