@@ -50,7 +50,7 @@ struct MarkSymbolVisitor<'a, 'tcx: 'a> {
50
50
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
51
51
tables : & ' a ty:: TypeckTables < ' tcx > ,
52
52
live_symbols : Box < FxHashSet < ast:: NodeId > > ,
53
- struct_has_extern_repr : bool ,
53
+ repr_has_repr_c : bool ,
54
54
in_pat : bool ,
55
55
inherited_pub_visibility : bool ,
56
56
ignore_variant_stack : Vec < DefId > ,
@@ -102,7 +102,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
102
102
fn handle_field_access ( & mut self , lhs : & hir:: Expr , name : ast:: Name ) {
103
103
match self . tables . expr_ty_adjusted ( lhs) . sty {
104
104
ty:: TyAdt ( def, _) => {
105
- self . insert_def_id ( def. struct_variant ( ) . field_named ( name) . did ) ;
105
+ self . insert_def_id ( def. non_enum_variant ( ) . field_named ( name) . did ) ;
106
106
}
107
107
_ => span_bug ! ( lhs. span, "named field access on non-ADT" ) ,
108
108
}
@@ -111,7 +111,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
111
111
fn handle_tup_field_access ( & mut self , lhs : & hir:: Expr , idx : usize ) {
112
112
match self . tables . expr_ty_adjusted ( lhs) . sty {
113
113
ty:: TyAdt ( def, _) => {
114
- self . insert_def_id ( def. struct_variant ( ) . fields [ idx] . did ) ;
114
+ self . insert_def_id ( def. non_enum_variant ( ) . fields [ idx] . did ) ;
115
115
}
116
116
ty:: TyTuple ( ..) => { }
117
117
_ => span_bug ! ( lhs. span, "numeric field access on non-ADT" ) ,
@@ -149,8 +149,8 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
149
149
}
150
150
151
151
fn visit_node ( & mut self , node : & hir_map:: Node < ' tcx > ) {
152
- let had_extern_repr = self . struct_has_extern_repr ;
153
- self . struct_has_extern_repr = false ;
152
+ let had_repr_c = self . repr_has_repr_c ;
153
+ self . repr_has_repr_c = false ;
154
154
let had_inherited_pub_visibility = self . inherited_pub_visibility ;
155
155
self . inherited_pub_visibility = false ;
156
156
match * node {
@@ -159,7 +159,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
159
159
hir:: ItemStruct ( ..) | hir:: ItemUnion ( ..) => {
160
160
let def_id = self . tcx . hir . local_def_id ( item. id ) ;
161
161
let def = self . tcx . adt_def ( def_id) ;
162
- self . struct_has_extern_repr = def. repr . c ( ) ;
162
+ self . repr_has_repr_c = def. repr . c ( ) ;
163
163
164
164
intravisit:: walk_item ( self , & item) ;
165
165
}
@@ -187,7 +187,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
187
187
}
188
188
_ => ( )
189
189
}
190
- self . struct_has_extern_repr = had_extern_repr ;
190
+ self . repr_has_repr_c = had_repr_c ;
191
191
self . inherited_pub_visibility = had_inherited_pub_visibility;
192
192
}
193
193
@@ -223,10 +223,10 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
223
223
224
224
fn visit_variant_data ( & mut self , def : & ' tcx hir:: VariantData , _: ast:: Name ,
225
225
_: & hir:: Generics , _: ast:: NodeId , _: syntax_pos:: Span ) {
226
- let has_extern_repr = self . struct_has_extern_repr ;
226
+ let has_repr_c = self . repr_has_repr_c ;
227
227
let inherited_pub_visibility = self . inherited_pub_visibility ;
228
228
let live_fields = def. fields ( ) . iter ( ) . filter ( |f| {
229
- has_extern_repr || inherited_pub_visibility || f. vis == hir:: Public
229
+ has_repr_c || inherited_pub_visibility || f. vis == hir:: Public
230
230
} ) ;
231
231
self . live_symbols . extend ( live_fields. map ( |f| f. id ) ) ;
232
232
@@ -428,7 +428,7 @@ fn find_live<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
428
428
tcx,
429
429
tables : & ty:: TypeckTables :: empty ( None ) ,
430
430
live_symbols : box FxHashSet ( ) ,
431
- struct_has_extern_repr : false ,
431
+ repr_has_repr_c : false ,
432
432
in_pat : false ,
433
433
inherited_pub_visibility : false ,
434
434
ignore_variant_stack : vec ! [ ] ,
0 commit comments