Skip to content

Commit 6930028

Browse files
committed
---
yaml --- r: 140650 b: refs/heads/try2 c: e18ed77 h: refs/heads/master v: v3
1 parent e13a3da commit 6930028

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 15164cc6a6b6a382b5cbe527e435dfa9eb162fd4
8+
refs/heads/try2: e18ed77b720b46cc8ae0e6754698c47f51bed9a0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ pub impl BorrowckCtxt {
615615
}
616616
}
617617

618-
LpExtend(lp_base, _, LpInterior(mc::interior_field(fld, _))) => {
618+
LpExtend(lp_base, _, LpInterior(mc::interior_field(fld))) => {
619619
self.append_loan_path_to_str_from_interior(lp_base, out);
620620
str::push_char(out, '.');
621621
str::push_str(out, *self.tcx.sess.intr().get(fld));

branches/try2/src/librustc/middle/mem_categorization.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub enum categorization {
6666
cat_local(ast::node_id), // local variable
6767
cat_arg(ast::node_id), // formal argument
6868
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
7070
cat_discr(cmt, ast::node_id), // match discriminant (see preserve())
7171
cat_self(ast::node_id), // explicit `self`
7272
}
@@ -94,8 +94,7 @@ pub enum interior_kind {
9494
interior_anon_field, // anonymous field (in e.g.
9595
// struct Foo(int, int);
9696
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
9998
interior_index(ty::t, // type of vec/str/etc being deref'd
10099
ast::mutability) // mutability of vec content
101100
}
@@ -395,8 +394,7 @@ pub impl mem_categorization_ctxt {
395394
assert!(!self.method_map.contains_key(&expr.id));
396395

397396
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))
400398
}
401399

402400
ast::expr_index(base, _) => {
@@ -579,16 +577,12 @@ pub impl mem_categorization_ctxt {
579577
node: N,
580578
base_cmt: cmt,
581579
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 {
587581
@cmt_ {
588582
id: node.id(),
589583
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(),
592586
ty: f_ty
593587
}
594588
}
@@ -886,8 +880,7 @@ pub impl mem_categorization_ctxt {
886880
// {f1: p1, ..., fN: pN}
887881
for field_pats.each |fp| {
888882
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);
891884
self.cat_pattern(cmt_field, fp.pat, op);
892885
}
893886
}
@@ -1141,7 +1134,7 @@ pub fn ptr_sigil(ptr: ptr_kind) -> ~str {
11411134
impl Repr for interior_kind {
11421135
fn repr(&self, tcx: ty::ctxt) -> ~str {
11431136
match *self {
1144-
interior_field(fld, _) => copy *tcx.sess.str_of(fld),
1137+
interior_field(fld) => copy *tcx.sess.str_of(fld),
11451138
interior_index(*) => ~"[]",
11461139
interior_tuple => ~"()",
11471140
interior_anon_field => ~"<anonymous field>",

0 commit comments

Comments
 (0)