Skip to content

Commit 42b1694

Browse files
committed
ident->name in middle
1 parent af259a6 commit 42b1694

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ fn enter_opt<'r>(bcx: @mut Block,
671671
let mut reordered_patterns = ~[];
672672
let r = ty::lookup_struct_fields(tcx, struct_id);
673673
for field in r.iter() {
674-
match field_pats.iter().find(|p| p.ident == field.ident) {
674+
match field_pats.iter().find(|p| p.ident.name
675+
== field.ident.name) {
675676
None => reordered_patterns.push(dummy),
676677
Some(fp) => reordered_patterns.push(fp.pat)
677678
}
@@ -752,7 +753,7 @@ fn enter_rec_or_struct<'r>(bcx: @mut Block,
752753
ast::PatStruct(_, ref fpats, _) => {
753754
let mut pats = ~[];
754755
for fname in fields.iter() {
755-
match fpats.iter().find(|p| p.ident == *fname) {
756+
match fpats.iter().find(|p| p.ident.name == fname.name) {
756757
None => pats.push(dummy),
757758
Some(pat) => pats.push(pat.pat)
758759
}
@@ -1102,7 +1103,7 @@ fn collect_record_or_struct_fields(bcx: @mut Block,
11021103
fn extend(idents: &mut ~[ast::Ident], field_pats: &[ast::FieldPat]) {
11031104
for field_pat in field_pats.iter() {
11041105
let field_ident = field_pat.ident;
1105-
if !idents.iter().any(|x| *x == field_ident) {
1106+
if !idents.iter().any(|x| x.name == field_ident.name) {
11061107
idents.push(field_ident);
11071108
}
11081109
}

src/librustc/middle/trans/reflect.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ impl Reflector {
256256
let fields = ty::struct_fields(tcx, did, substs);
257257
let mut named_fields = false;
258258
if !fields.is_empty() {
259-
named_fields = fields[0].ident != special_idents::unnamed_field;
259+
named_fields =
260+
fields[0].ident.name != special_idents::unnamed_field.name;
260261
}
261262

262263
let extra = ~[self.c_slice(ty_to_str(tcx, t).to_managed()),

0 commit comments

Comments
 (0)