Skip to content

Commit 254c744

Browse files
committed
---
yaml --- r: 166779 b: refs/heads/master c: 4f2b0f0 h: refs/heads/master i: 166777: 447aa34 166775: 2ac226e v: v3
1 parent 38bb78b commit 254c744

File tree

35 files changed

+152
-140
lines changed

35 files changed

+152
-140
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: 7cd6bf67a2ccfe37912271f576ba2b1e1a568162
2+
refs/heads/master: 4f2b0f032a2b479b6cf728646283bf6e46b32098
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 023dfb0c898d851dee6ace2f8339b73b5287136b
55
refs/heads/try: f5d619caf9f32458680fae55526b99582ca682dd

trunk/src/librustc/metadata/tydecode.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ fn parse_substs<'a, 'tcx>(st: &mut PState<'a, 'tcx>,
262262
let types =
263263
parse_vec_per_param_space(st, |st| parse_ty(st, |x,y| conv(x,y)));
264264

265-
return subst::Substs { types: types,
266-
regions: regions };
265+
subst::Substs { types: types,
266+
regions: regions }
267267
}
268268

269269
fn parse_region_substs(st: &mut PState, conv: conv_did) -> subst::RegionSubsts {
@@ -380,7 +380,7 @@ fn parse_trait_ref<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did)
380380
-> ty::TraitRef<'tcx> {
381381
let def = parse_def(st, NominalType, |x,y| conv(x,y));
382382
let substs = parse_substs(st, |x,y| conv(x,y));
383-
ty::TraitRef {def_id: def, substs: substs}
383+
ty::TraitRef {def_id: def, substs: st.tcx.mk_substs(substs)}
384384
}
385385

386386
fn parse_ty<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did) -> Ty<'tcx> {
@@ -409,7 +409,7 @@ fn parse_ty<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did) -> Ty<'tcx> {
409409
let def = parse_def(st, NominalType, |x,y| conv(x,y));
410410
let substs = parse_substs(st, |x,y| conv(x,y));
411411
assert_eq!(next(st), ']');
412-
return ty::mk_enum(st.tcx, def, substs);
412+
return ty::mk_enum(st.tcx, def, st.tcx.mk_substs(substs));
413413
}
414414
'x' => {
415415
assert_eq!(next(st), '[');
@@ -490,15 +490,15 @@ fn parse_ty<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did) -> Ty<'tcx> {
490490
let did = parse_def(st, NominalType, |x,y| conv(x,y));
491491
let substs = parse_substs(st, |x,y| conv(x,y));
492492
assert_eq!(next(st), ']');
493-
return ty::mk_struct(st.tcx, did, substs);
493+
return ty::mk_struct(st.tcx, did, st.tcx.mk_substs(substs));
494494
}
495495
'k' => {
496496
assert_eq!(next(st), '[');
497497
let did = parse_def(st, UnboxedClosureSource, |x,y| conv(x,y));
498498
let region = parse_region(st, |x,y| conv(x,y));
499499
let substs = parse_substs(st, |x,y| conv(x,y));
500500
assert_eq!(next(st), ']');
501-
return ty::mk_unboxed_closure(st.tcx, did, region, substs);
501+
return ty::mk_unboxed_closure(st.tcx, did, region, st.tcx.mk_substs(substs));
502502
}
503503
'e' => {
504504
return ty::mk_err();

trunk/src/librustc/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ fn enc_bound_region(w: &mut SeekableMemWriter, cx: &ctxt, br: ty::BoundRegion) {
301301
pub fn enc_trait_ref<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
302302
s: &ty::TraitRef<'tcx>) {
303303
mywrite!(w, "{}|", (cx.ds)(s.def_id));
304-
enc_substs(w, cx, &s.substs);
304+
enc_substs(w, cx, s.substs);
305305
}
306306

307307
pub fn enc_trait_store(w: &mut SeekableMemWriter, cx: &ctxt, s: ty::TraitStore) {

trunk/src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
767767
// Select just those fields of the `with`
768768
// expression that will actually be used
769769
let with_fields = match with_cmt.ty.sty {
770-
ty::ty_struct(did, ref substs) => {
770+
ty::ty_struct(did, substs) => {
771771
ty::struct_fields(self.tcx(), did, substs)
772772
}
773773
_ => {
@@ -1271,4 +1271,3 @@ fn copy_or_move<'tcx>(tcx: &ty::ctxt<'tcx>,
12711271
Copy
12721272
}
12731273
}
1274-

trunk/src/librustc/middle/infer/coercion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
358358
bounds: bounds },
359359
ty_a)))
360360
}
361-
(&ty::ty_struct(did_a, ref substs_a), &ty::ty_struct(did_b, ref substs_b))
361+
(&ty::ty_struct(did_a, substs_a), &ty::ty_struct(did_b, substs_b))
362362
if did_a == did_b => {
363363
debug!("unsizing a struct");
364364
// Try unsizing each type param in turn to see if we end up with ty_b.
@@ -383,7 +383,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
383383
// Check that the whole types match.
384384
let mut new_substs = substs_a.clone();
385385
new_substs.types.get_mut_slice(subst::TypeSpace)[i] = new_tp;
386-
let ty = ty::mk_struct(tcx, did_a, new_substs);
386+
let ty = ty::mk_struct(tcx, did_a, tcx.mk_substs(new_substs));
387387
if self.get_ref().infcx.try(|_| sub.tys(ty, ty_b)).is_err() {
388388
debug!("Unsized type parameter '{}', but still \
389389
could not match types {} and {}",

trunk/src/librustc/middle/infer/combine.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,13 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C,
470470
Ok(a)
471471
}
472472

473-
(&ty::ty_enum(a_id, ref a_substs),
474-
&ty::ty_enum(b_id, ref b_substs))
473+
(&ty::ty_enum(a_id, a_substs),
474+
&ty::ty_enum(b_id, b_substs))
475475
if a_id == b_id => {
476476
let substs = try!(this.substs(a_id,
477477
a_substs,
478478
b_substs));
479-
Ok(ty::mk_enum(tcx, a_id, substs))
479+
Ok(ty::mk_enum(tcx, a_id, tcx.mk_substs(substs)))
480480
}
481481

482482
(&ty::ty_trait(ref a_),
@@ -487,21 +487,21 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C,
487487
Ok(ty::mk_trait(tcx, principal, bounds))
488488
}
489489

490-
(&ty::ty_struct(a_id, ref a_substs), &ty::ty_struct(b_id, ref b_substs))
490+
(&ty::ty_struct(a_id, a_substs), &ty::ty_struct(b_id, b_substs))
491491
if a_id == b_id => {
492492
let substs = try!(this.substs(a_id, a_substs, b_substs));
493-
Ok(ty::mk_struct(tcx, a_id, substs))
493+
Ok(ty::mk_struct(tcx, a_id, tcx.mk_substs(substs)))
494494
}
495495

496-
(&ty::ty_unboxed_closure(a_id, a_region, ref a_substs),
497-
&ty::ty_unboxed_closure(b_id, b_region, ref b_substs))
496+
(&ty::ty_unboxed_closure(a_id, a_region, a_substs),
497+
&ty::ty_unboxed_closure(b_id, b_region, b_substs))
498498
if a_id == b_id => {
499499
// All ty_unboxed_closure types with the same id represent
500500
// the (anonymous) type of the same closure expression. So
501501
// all of their regions should be equated.
502502
let region = try!(this.equate().regions(a_region, b_region));
503503
let substs = try!(this.substs_variances(None, a_substs, b_substs));
504-
Ok(ty::mk_unboxed_closure(tcx, a_id, region, substs))
504+
Ok(ty::mk_unboxed_closure(tcx, a_id, region, tcx.mk_substs(substs)))
505505
}
506506

507507
(&ty::ty_uniq(a_inner), &ty::ty_uniq(b_inner)) => {
@@ -813,5 +813,3 @@ impl<'cx, 'tcx> ty_fold::TypeFolder<'tcx> for Generalizer<'cx, 'tcx> {
813813
self.infcx.next_region_var(MiscVariable(self.span))
814814
}
815815
}
816-
817-

trunk/src/librustc/middle/intrinsicck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn type_size_is_affected_by_type_parameters<'tcx>(tcx: &ty::ctxt<'tcx>, typ: Ty<
3737
// No need to continue; we now know the result.
3838
false
3939
}
40-
ty::ty_enum(did, ref substs) => {
40+
ty::ty_enum(did, substs) => {
4141
for enum_variant in (*ty::enum_variants(tcx, did)).iter() {
4242
for argument_type in enum_variant.args.iter() {
4343
let argument_type = argument_type.subst(tcx, substs);
@@ -51,7 +51,7 @@ fn type_size_is_affected_by_type_parameters<'tcx>(tcx: &ty::ctxt<'tcx>, typ: Ty<
5151
// Don't traverse substitutions.
5252
false
5353
}
54-
ty::ty_struct(did, ref substs) => {
54+
ty::ty_struct(did, substs) => {
5555
for field in ty::struct_fields(tcx, did, substs).iter() {
5656
result = result ||
5757
type_size_is_affected_by_type_parameters(tcx,

trunk/src/librustc/middle/traits/select.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12101210
Ok(If(tys.clone()))
12111211
}
12121212

1213-
ty::ty_unboxed_closure(def_id, _, ref substs) => {
1213+
ty::ty_unboxed_closure(def_id, _, substs) => {
12141214
// FIXME -- This case is tricky. In the case of by-ref
12151215
// closures particularly, we need the results of
12161216
// inference to decide how to reflect the type of each
@@ -1248,7 +1248,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12481248
}
12491249
}
12501250

1251-
ty::ty_struct(def_id, ref substs) => {
1251+
ty::ty_struct(def_id, substs) => {
12521252
let types: Vec<Ty> =
12531253
ty::struct_fields(self.tcx(), def_id, substs)
12541254
.iter()
@@ -1257,7 +1257,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12571257
nominal(self, bound, def_id, types)
12581258
}
12591259

1260-
ty::ty_enum(def_id, ref substs) => {
1260+
ty::ty_enum(def_id, substs) => {
12611261
let types: Vec<Ty> =
12621262
ty::substd_enum_variants(self.tcx(), def_id, substs)
12631263
.iter()
@@ -1574,7 +1574,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
15741574
self_ty);
15751575
let trait_ref = Rc::new(ty::Binder(ty::TraitRef {
15761576
def_id: obligation.trait_ref.def_id(),
1577-
substs: substs,
1577+
substs: self.tcx().mk_substs(substs),
15781578
}));
15791579

15801580
try!(self.confirm_poly_trait_refs(obligation.cause.clone(),
@@ -1615,7 +1615,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
16151615
obligation.self_ty());
16161616
let trait_ref = Rc::new(ty::Binder(ty::TraitRef {
16171617
def_id: obligation.trait_ref.def_id(),
1618-
substs: substs,
1618+
substs: self.tcx().mk_substs(substs),
16191619
}));
16201620

16211621
debug!("confirm_unboxed_closure_candidate(closure_def_id={}, trait_ref={})",

trunk/src/librustc/middle/traits/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
32
// file at the top-level directory of this distribution and at
43
// http://rust-lang.org/COPYRIGHT.
@@ -276,7 +275,7 @@ pub fn poly_trait_ref_for_builtin_bound<'tcx>(
276275
Ok(def_id) => {
277276
Ok(Rc::new(ty::Binder(ty::TraitRef {
278277
def_id: def_id,
279-
substs: Substs::empty().with_self_ty(param_ty)
278+
substs: tcx.mk_substs(Substs::empty().with_self_ty(param_ty))
280279
})))
281280
}
282281
Err(e) => {

0 commit comments

Comments
 (0)