Skip to content

Commit 04b5150

Browse files
committed
---
yaml --- r: 166761 b: refs/heads/master c: e6b6234 h: refs/heads/master i: 166759: 0f1ee11 v: v3
1 parent ce3115e commit 04b5150

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e954fc4385e92907916135244fd2fe0e47b24deb
2+
refs/heads/master: e6b6234e66539a3e80aa48281ea1b72464eb90df
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 023dfb0c898d851dee6ace2f8339b73b5287136b
55
refs/heads/try: f5d619caf9f32458680fae55526b99582ca682dd

trunk/src/librustc_trans/trans/adt.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,21 @@ fn find_discr_field_candidate<'tcx>(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> Optio
375375
None
376376
},
377377

378+
// Can we use one of the fields in this tuple?
379+
ty::ty_tup(ref tys) => {
380+
for (j, &ty) in tys.iter().enumerate() {
381+
match find_discr_field_candidate(tcx, ty) {
382+
Some(v) => {
383+
let mut discrfield = vec![j];
384+
discrfield.extend(v.into_iter());
385+
return Some(discrfield);
386+
}
387+
None => continue
388+
}
389+
}
390+
None
391+
},
392+
378393
// Anything else is not a pointer
379394
_ => None
380395
}

0 commit comments

Comments
 (0)