Skip to content

Commit 1d19e0c

Browse files
csmoeoli-obk
authored andcommitted
VariantKind
1 parent 14893ba commit 1d19e0c

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

src/librustc/hir/lowering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ impl<'a> LoweringContext<'a> {
15071507

15081508
fn lower_variant(&mut self, v: &Variant) -> hir::Variant {
15091509
Spanned {
1510-
node: hir::Variant_ {
1510+
node: hir::VariantKind {
15111511
name: v.node.ident.name,
15121512
attrs: self.lower_attrs(&v.node.attrs),
15131513
data: self.lower_variant_data(&v.node.data),

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ impl<T:Named> Named for Spanned<T> { fn name(&self) -> Name { self.node.name() }
11761176

11771177
impl Named for Item { fn name(&self) -> Name { self.name } }
11781178
impl Named for ForeignItem { fn name(&self) -> Name { self.name } }
1179-
impl Named for Variant_ { fn name(&self) -> Name { self.name } }
1179+
impl Named for VariantKind { fn name(&self) -> Name { self.name } }
11801180
impl Named for StructField { fn name(&self) -> Name { self.ident.name } }
11811181
impl Named for TraitItem { fn name(&self) -> Name { self.ident.name } }
11821182
impl Named for ImplItem { fn name(&self) -> Name { self.ident.name } }

src/librustc/hir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,15 +1878,15 @@ pub struct EnumDef {
18781878
}
18791879

18801880
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
1881-
pub struct Variant_ {
1881+
pub struct VariantKind {
18821882
pub name: Name,
18831883
pub attrs: HirVec<Attribute>,
18841884
pub data: VariantData,
18851885
/// Explicit discriminant, eg `Foo = 1`
18861886
pub disr_expr: Option<AnonConst>,
18871887
}
18881888

1889-
pub type Variant = Spanned<Variant_>;
1889+
pub type Variant = Spanned<VariantKind>;
18901890

18911891
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug)]
18921892
pub enum UseKind {

src/librustc/ich/impls_hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,14 +793,14 @@ impl_stable_hash_for!(struct hir::EnumDef {
793793
variants
794794
});
795795

796-
impl_stable_hash_for!(struct hir::Variant_ {
796+
impl_stable_hash_for!(struct hir::VariantKind {
797797
name,
798798
attrs,
799799
data,
800800
disr_expr
801801
});
802802

803-
impl_stable_hash_for_spanned!(hir::Variant_);
803+
impl_stable_hash_for_spanned!(hir::VariantKind);
804804

805805
impl_stable_hash_for!(enum hir::UseKind {
806806
Single,

src/librustc/middle/dead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
475475
&& !has_allow_dead_code_or_lang_attr(self.tcx, field.id, &field.attrs)
476476
}
477477

478-
fn should_warn_about_variant(&mut self, variant: &hir::Variant_) -> bool {
478+
fn should_warn_about_variant(&mut self, variant: &hir::VariantKind) -> bool {
479479
!self.symbol_is_live(variant.data.id(), None)
480480
&& !has_allow_dead_code_or_lang_attr(self.tcx,
481481
variant.data.id(),

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
981981
}
982982
hir::map::NodeVariant(&hir::Variant {
983983
span,
984-
node: hir::Variant_ {
984+
node: hir::VariantKind {
985985
data: hir::VariantData::Tuple(ref fields, _),
986986
..
987987
},

src/librustc_typeck/collect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
10901090
}
10911091

10921092
NodeStructCtor(&ref def) |
1093-
NodeVariant(&Spanned { node: hir::Variant_ { data: ref def, .. }, .. }) => {
1093+
NodeVariant(&Spanned { node: hir::VariantKind { data: ref def, .. }, .. }) => {
10941094
match *def {
10951095
VariantData::Unit(..) | VariantData::Struct(..) => {
10961096
tcx.type_of(tcx.hir.get_parent_did(node_id))
@@ -1123,7 +1123,7 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
11231123
NodeExpr(&hir::Expr { node: ExprRepeat(_, ref constant), .. })
11241124
if constant.id == node_id => tcx.types.usize,
11251125

1126-
NodeVariant(&Spanned { node: Variant_ { disr_expr: Some(ref e), .. }, .. })
1126+
NodeVariant(&Spanned { node: VariantKind { disr_expr: Some(ref e), .. }, .. })
11271127
if e.id == node_id => {
11281128
tcx.adt_def(tcx.hir.get_parent_did(node_id))
11291129
.repr.discr_type().to_ty(tcx)
@@ -1175,7 +1175,7 @@ fn fn_sig<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
11751175
}
11761176

11771177
NodeStructCtor(&VariantData::Tuple(ref fields, _)) |
1178-
NodeVariant(&Spanned { node: hir::Variant_ {
1178+
NodeVariant(&Spanned { node: hir::VariantKind {
11791179
data: VariantData::Tuple(ref fields, _), ..
11801180
}, .. }) => {
11811181
let ty = tcx.type_of(tcx.hir.get_parent_did(node_id));

0 commit comments

Comments
 (0)