@@ -66,7 +66,7 @@ pub enum categorization {
66
66
cat_local( ast:: node_id ) , // local variable
67
67
cat_arg( ast:: node_id ) , // formal argument
68
68
cat_deref( cmt , uint , ptr_kind ) , // deref of a ptr
69
- cat_interior( cmt , interior_kind ) , // something interior
69
+ cat_interior( cmt , interior_kind ) , // something interior
70
70
cat_discr( cmt , ast:: node_id ) , // match discriminant (see preserve())
71
71
cat_self( ast:: node_id ) , // explicit `self`
72
72
}
@@ -94,8 +94,7 @@ pub enum interior_kind {
94
94
interior_anon_field, // anonymous field (in e.g.
95
95
// struct Foo(int, int);
96
96
interior_variant( ast:: def_id ) , // internals to a variant of given enum
97
- interior_field( ast:: ident , // name of field
98
- ast:: mutability ) , // declared mutability of field
97
+ interior_field( ast:: ident ) , // name of field
99
98
interior_index( ty:: t , // type of vec/str/etc being deref'd
100
99
ast:: mutability ) // mutability of vec content
101
100
}
@@ -395,8 +394,7 @@ pub impl mem_categorization_ctxt {
395
394
assert ! ( !self . method_map. contains_key( & expr. id) ) ;
396
395
397
396
let base_cmt = self . cat_expr ( base) ;
398
- self . cat_field ( expr, base_cmt, f_name,
399
- self . expr_ty ( expr) , expr. id )
397
+ self . cat_field ( expr, base_cmt, f_name, self . expr_ty ( expr) )
400
398
}
401
399
402
400
ast:: expr_index( base, _) => {
@@ -579,16 +577,12 @@ pub impl mem_categorization_ctxt {
579
577
node : N ,
580
578
base_cmt : cmt ,
581
579
f_name : ast:: ident ,
582
- f_ty : ty:: t ,
583
- field_id : ast:: node_id ) -> cmt {
584
- let f_mutbl = m_imm;
585
- let m = self . inherited_mutability ( base_cmt. mutbl , f_mutbl) ;
586
- let f_interior = interior_field ( f_name, f_mutbl) ;
580
+ f_ty : ty:: t ) -> cmt {
587
581
@cmt_ {
588
582
id : node. id ( ) ,
589
583
span : node. span ( ) ,
590
- cat : cat_interior ( base_cmt, f_interior ) ,
591
- mutbl : m ,
584
+ cat : cat_interior ( base_cmt, interior_field ( f_name ) ) ,
585
+ mutbl : base_cmt . mutbl . inherit ( ) ,
592
586
ty : f_ty
593
587
}
594
588
}
@@ -886,8 +880,7 @@ pub impl mem_categorization_ctxt {
886
880
// {f1: p1, ..., fN: pN}
887
881
for field_pats. each |fp| {
888
882
let field_ty = self . pat_ty ( fp. pat ) ; // see (*)
889
- let cmt_field = self . cat_field ( pat, cmt, fp. ident ,
890
- field_ty, pat. id ) ;
883
+ let cmt_field = self . cat_field ( pat, cmt, fp. ident , field_ty) ;
891
884
self . cat_pattern ( cmt_field, fp. pat , op) ;
892
885
}
893
886
}
@@ -1141,7 +1134,7 @@ pub fn ptr_sigil(ptr: ptr_kind) -> ~str {
1141
1134
impl Repr for interior_kind {
1142
1135
fn repr(&self, tcx: ty::ctxt) -> ~str {
1143
1136
match *self {
1144
- interior_field(fld, _ ) => copy *tcx.sess.str_of(fld),
1137
+ interior_field(fld) => copy *tcx.sess.str_of(fld),
1145
1138
interior_index(*) => ~" [ ] ",
1146
1139
interior_tuple => ~"( ) ",
1147
1140
interior_anon_field => ~"<anonymous field>",
0 commit comments