Skip to content

Commit b2cc8c5

Browse files
committed
---
yaml --- r: 213975 b: refs/heads/master c: b510ea1 h: refs/heads/master i: 213973: 46e358c 213971: ff3fae7 213967: 3e45faf v: v3
1 parent f0277d3 commit b2cc8c5

File tree

21 files changed

+23
-55
lines changed

21 files changed

+23
-55
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: a3727559c6eee465893f400ec4edad77be868f3c
2+
refs/heads/master: b510ea1487286123c00f425b368a8328637ac947
33
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustc/middle/free_region.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ impl FreeRegionMap {
2929
}
3030

3131
pub fn relate_free_regions_from_implications<'tcx>(&mut self,
32-
tcx: &ty::ctxt<'tcx>,
3332
implications: &[Implication<'tcx>])
3433
{
3534
for implication in implications {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ impl<'a, 'tcx> CombineFields<'a, 'tcx> {
187187
b_vid: ty::TyVid)
188188
-> RelateResult<'tcx, ()>
189189
{
190-
let tcx = self.infcx.tcx;
191190
let mut stack = Vec::new();
192191
stack.push((a_ty, dir, b_vid));
193192
loop {

trunk/src/librustc/middle/infer/higher_ranked/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ impl<'a,'tcx> HigherRankedRelations<'a,'tcx> for CombineFields<'a,'tcx> {
4646
-> RelateResult<'tcx, Binder<T>>
4747
where T: Relate<'a,'tcx>
4848
{
49-
let tcx = self.infcx.tcx;
50-
5149
debug!("higher_ranked_sub(a={}, b={})",
5250
a.repr(), b.repr());
5351

trunk/src/librustc/middle/mem_categorization.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
418418
}
419419

420420
fn pat_ty(&self, pat: &ast::Pat) -> McResult<Ty<'tcx>> {
421-
let tcx = self.typer.tcx();
422421
let base_ty = try!(self.typer.node_ty(pat.id));
423422
// FIXME (Issue #18207): This code detects whether we are
424423
// looking at a `ref x`, and if so, figures out what the type

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ fn overlap(selcx: &mut SelectionContext,
8181
debug!("overlap: subtraitref check succeeded");
8282

8383
// Are any of the obligations unsatisfiable? If so, no overlap.
84-
let tcx = selcx.tcx();
8584
let infcx = selcx.infcx();
8685
let opt_failing_obligation =
8786
a_obligations.iter()
@@ -155,7 +154,7 @@ fn impl_trait_ref_and_oblig<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
155154
let Normalized { value: predicates, obligations: normalization_obligations2 } =
156155
project::normalize(selcx, ObligationCause::dummy(), &predicates);
157156
let impl_obligations =
158-
util::predicates_for_generics(selcx.tcx(), ObligationCause::dummy(), 0, &predicates);
157+
util::predicates_for_generics(ObligationCause::dummy(), 0, &predicates);
159158

160159
let impl_obligations: Vec<_> =
161160
impl_obligations.into_iter()

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,11 @@ impl<'tcx> FulfillmentContext<'tcx> {
171171
}
172172

173173
pub fn register_region_obligation<'a>(&mut self,
174-
infcx: &InferCtxt<'a,'tcx>,
175174
t_a: Ty<'tcx>,
176175
r_b: ty::Region,
177176
cause: ObligationCause<'tcx>)
178177
{
179-
register_region_obligation(infcx.tcx, t_a, r_b, cause, &mut self.region_obligations);
178+
register_region_obligation(t_a, r_b, cause, &mut self.region_obligations);
180179
}
181180

182181
pub fn register_predicate_obligation<'a>(&mut self,
@@ -366,7 +365,6 @@ fn process_predicate<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
366365
* type inference.
367366
*/
368367

369-
let tcx = selcx.tcx();
370368
match obligation.predicate {
371369
ty::Predicate::Trait(ref data) => {
372370
let trait_obligation = obligation.with(data.clone());
@@ -430,7 +428,7 @@ fn process_predicate<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
430428
CodeSelectionError(Unimplemented)));
431429
} else {
432430
let ty::OutlivesPredicate(t_a, r_b) = binder.0;
433-
register_region_obligation(tcx, t_a, r_b,
431+
register_region_obligation(t_a, r_b,
434432
obligation.cause.clone(),
435433
region_obligations);
436434
}
@@ -471,8 +469,7 @@ impl<'tcx> Repr for RegionObligation<'tcx> {
471469
}
472470
}
473471

474-
fn register_region_obligation<'tcx>(tcx: &ty::ctxt<'tcx>,
475-
t_a: Ty<'tcx>,
472+
fn register_region_obligation<'tcx>(t_a: Ty<'tcx>,
476473
r_b: ty::Region,
477474
cause: ObligationCause<'tcx>,
478475
region_obligations: &mut NodeMap<Vec<RegionObligation<'tcx>>>)

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,11 @@ pub struct VtableObjectData<'tcx> {
300300
}
301301

302302
/// Creates predicate obligations from the generic bounds.
303-
pub fn predicates_for_generics<'tcx>(tcx: &ty::ctxt<'tcx>,
304-
cause: ObligationCause<'tcx>,
303+
pub fn predicates_for_generics<'tcx>(cause: ObligationCause<'tcx>,
305304
generic_bounds: &ty::InstantiatedPredicates<'tcx>)
306305
-> PredicateObligations<'tcx>
307306
{
308-
util::predicates_for_generics(tcx, cause, 0, generic_bounds)
307+
util::predicates_for_generics(cause, 0, generic_bounds)
309308
}
310309

311310
/// Determines whether the type `ty` is known to meet `bound` and
@@ -436,8 +435,6 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
436435
-> Result<T, Vec<FulfillmentError<'tcx>>>
437436
where T : TypeFoldable<'tcx> + HasProjectionTypes + Clone + Repr
438437
{
439-
let tcx = closure_typer.tcx();
440-
441438
debug!("normalize_param_env(value={})", value.repr());
442439

443440
let mut selcx = &mut SelectionContext::new(infcx, closure_typer);

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ fn opt_normalize_projection_type<'a,'b,'tcx>(
373373
obligations.repr());
374374

375375
if ty::type_has_projection(projected_ty) {
376-
let tcx = selcx.tcx();
377376
let mut normalizer = AssociatedTypeNormalizer::new(selcx, cause, depth);
378377
let normalized_ty = normalizer.fold(&projected_ty);
379378

@@ -633,7 +632,6 @@ fn assemble_candidates_from_object_type<'cx,'tcx>(
633632
candidate_set: &mut ProjectionTyCandidateSet<'tcx>,
634633
object_ty: Ty<'tcx>)
635634
{
636-
let infcx = selcx.infcx();
637635
debug!("assemble_candidates_from_object_type(object_ty={})",
638636
object_ty.repr());
639637
let data = match object_ty.sty {
@@ -745,8 +743,6 @@ fn confirm_candidate<'cx,'tcx>(
745743
candidate: ProjectionTyCandidate<'tcx>)
746744
-> (Ty<'tcx>, Vec<PredicateObligation<'tcx>>)
747745
{
748-
let infcx = selcx.infcx();
749-
750746
debug!("confirm_candidate(candidate={}, obligation={})",
751747
candidate.repr(),
752748
obligation.repr());

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,8 +2896,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
28962896
let predicates = normalize_with_depth(self, cause.clone(), recursion_depth, &predicates);
28972897
let mut predicates = self.infcx().plug_leaks(skol_map, snapshot, &predicates);
28982898
let mut obligations =
2899-
util::predicates_for_generics(self.tcx(),
2900-
cause,
2899+
util::predicates_for_generics(cause,
29012900
recursion_depth,
29022901
&predicates.value);
29032902
obligations.append(&mut predicates.obligations);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ impl<'tcx> fmt::Debug for super::VtableObjectData<'tcx> {
321321
}
322322

323323
/// See `super::obligations_for_generics`
324-
pub fn predicates_for_generics<'tcx>(tcx: &ty::ctxt<'tcx>,
325-
cause: ObligationCause<'tcx>,
324+
pub fn predicates_for_generics<'tcx>(cause: ObligationCause<'tcx>,
326325
recursion_depth: usize,
327326
generic_bounds: &ty::InstantiatedPredicates<'tcx>)
328327
-> Vec<PredicateObligation<'tcx>>

trunk/src/librustc/middle/ty_relate/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ fn relate_region_params<'a,'tcx:'a,R>(relation: &mut R,
191191
-> RelateResult<'tcx, Vec<ty::Region>>
192192
where R: TypeRelation<'a,'tcx>
193193
{
194-
let tcx = relation.tcx();
195194
let num_region_params = a_rs.len();
196195

197196
debug!("relate_region_params(a_rs={}, \

trunk/src/librustc_borrowck/borrowck/fragments.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,15 @@ enum Fragment {
4242
}
4343

4444
impl Fragment {
45-
fn loan_path_repr<'tcx>(&self, move_data: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) -> String {
45+
fn loan_path_repr(&self, move_data: &MoveData) -> String {
4646
let repr = |mpi| move_data.path_loan_path(mpi).repr();
4747
match *self {
4848
Just(mpi) => repr(mpi),
4949
AllButOneFrom(mpi) => format!("$(allbutone {})", repr(mpi)),
5050
}
5151
}
5252

53-
fn loan_path_user_string<'tcx>(&self,
54-
move_data: &MoveData<'tcx>,
55-
tcx: &ty::ctxt<'tcx>) -> String {
53+
fn loan_path_user_string(&self, move_data: &MoveData) -> String {
5654
let user_string = |mpi| move_data.path_loan_path(mpi).user_string();
5755
match *self {
5856
Just(mpi) => user_string(mpi),
@@ -138,7 +136,7 @@ pub fn instrument_move_fragments<'tcx>(this: &MoveData<'tcx>,
138136

139137
let instrument_all_fragments = |kind, vec_rc: &Vec<Fragment>| {
140138
for (i, f) in vec_rc.iter().enumerate() {
141-
let render = || f.loan_path_user_string(this, tcx);
139+
let render = || f.loan_path_user_string(this);
142140
if span_err {
143141
tcx.sess.span_err(sp, &format!("{}: `{}`", kind, render()));
144142
}
@@ -176,7 +174,7 @@ pub fn fixup_fragment_sets<'tcx>(this: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) {
176174
};
177175

178176
let frag_lps = |fs: &[Fragment]| -> Vec<String> {
179-
fs.iter().map(|f| f.loan_path_repr(this, tcx)).collect()
177+
fs.iter().map(|f| f.loan_path_repr(this)).collect()
180178
};
181179

182180
// First, filter out duplicates

trunk/src/librustc_trans/trans/base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,6 @@ pub fn trans_named_tuple_constructor<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
16711671
-> Result<'blk, 'tcx> {
16721672

16731673
let ccx = bcx.fcx.ccx;
1674-
let tcx = ccx.tcx();
16751674

16761675
let result_ty = match ctor_ty.sty {
16771676
ty::TyBareFn(_, ref bft) => {

trunk/src/librustc_trans/trans/foreign.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
233233
-> Block<'blk, 'tcx>
234234
{
235235
let ccx = bcx.ccx();
236-
let tcx = bcx.tcx();
237236

238237
debug!("trans_native_call(callee_ty={}, \
239238
llfn={}, \
@@ -636,7 +635,6 @@ pub fn trans_rust_fn_with_foreign_abi<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
636635
t: Ty<'tcx>) {
637636
let _icx = push_ctxt(
638637
"foreign::trans_rust_fn_with_foreign_abi::build_wrap_fn");
639-
let tcx = ccx.tcx();
640638

641639
debug!("build_wrap_fn(llrustfn={}, llwrapfn={}, t={})",
642640
ccx.tn().val_to_string(llrustfn),

trunk/src/librustc_trans/trans/glue.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ impl<'tcx> DropGlueKind<'tcx> {
203203
DropGlueKind::TyContents(t) => DropGlueKind::TyContents(f(t)),
204204
}
205205
}
206+
}
206207

207-
fn to_string<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> String {
208+
impl<'tcx> Repr for DropGlueKind<'tcx> {
209+
fn repr(&self) -> String {
208210
match *self {
209211
DropGlueKind::Ty(ty) => {
210212
format!("DropGlueKind::Ty({})", ty.repr())
@@ -218,9 +220,9 @@ impl<'tcx> DropGlueKind<'tcx> {
218220

219221
fn get_drop_glue_core<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
220222
g: DropGlueKind<'tcx>) -> ValueRef {
221-
debug!("make drop glue for {}", g.to_string(ccx));
223+
debug!("make drop glue for {}", g.repr());
222224
let g = g.map_ty(|t| get_drop_glue_type(ccx, t));
223-
debug!("drop glue type {}", g.to_string(ccx));
225+
debug!("drop glue type {}", g.repr());
224226
match ccx.drop_glues().borrow().get(&g) {
225227
Some(&glue) => return glue,
226228
_ => { }

trunk/src/librustc_typeck/check/assoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use middle::infer::InferCtxt;
1212
use middle::traits::{self, FulfillmentContext, Normalized, MiscObligation,
1313
SelectionContext, ObligationCause};
1414
use middle::ty::{self, HasProjectionTypes};
15-
use middle::ty_fold::{TypeFoldable, TypeFolder};
15+
use middle::ty_fold::TypeFoldable;
1616
use syntax::ast;
1717
use syntax::codemap::Span;
1818
use util::ppaux::Repr;

trunk/src/librustc_typeck/check/method/probe.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> {
10621062

10631063
// Convert the bounds into obligations.
10641064
let obligations =
1065-
traits::predicates_for_generics(self.tcx(),
1066-
cause.clone(),
1065+
traits::predicates_for_generics(cause.clone(),
10671066
&impl_bounds);
10681067
debug!("impl_obligations={}", obligations.repr());
10691068

trunk/src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17451745
cause: traits::ObligationCause<'tcx>)
17461746
{
17471747
let mut fulfillment_cx = self.inh.fulfillment_cx.borrow_mut();
1748-
fulfillment_cx.register_region_obligation(self.infcx(), ty, region, cause);
1748+
fulfillment_cx.register_region_obligation(ty, region, cause);
17491749
}
17501750

17511751
pub fn add_default_region_param_bounds(&self,
@@ -1787,9 +1787,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17871787
debug!("add_obligations_for_parameters(predicates={})",
17881788
predicates.repr());
17891789

1790-
for obligation in traits::predicates_for_generics(self.tcx(),
1791-
cause,
1792-
predicates) {
1790+
for obligation in traits::predicates_for_generics(cause, predicates) {
17931791
self.register_predicate(obligation);
17941792
}
17951793
}

trunk/src/librustc_typeck/check/regionck.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ impl<'a, 'tcx> Rcx<'a, 'tcx> {
348348
body_id: ast::NodeId,
349349
span: Span) {
350350
debug!("relate_free_regions >>");
351-
let tcx = self.tcx();
352351

353352
for &ty in fn_sig_tys {
354353
let ty = self.resolve_type(ty);
@@ -359,7 +358,7 @@ impl<'a, 'tcx> Rcx<'a, 'tcx> {
359358
ty, body_scope, span);
360359

361360
// Record any relations between free regions that we observe into the free-region-map.
362-
self.free_region_map.relate_free_regions_from_implications(tcx, &implications);
361+
self.free_region_map.relate_free_regions_from_implications(&implications);
363362

364363
// But also record other relationships, such as `T:'x`,
365364
// that don't go into the free-region-map but which we use
@@ -823,7 +822,6 @@ fn constrain_call<'a, I: Iterator<Item=&'a ast::Expr>>(rcx: &mut Rcx,
823822
//! in the type of the function. Also constrains the regions that
824823
//! appear in the arguments appropriately.
825824
826-
let tcx = rcx.fcx.tcx();
827825
debug!("constrain_call(call_expr={}, \
828826
receiver={}, \
829827
implicitly_ref_args={})",
@@ -1156,7 +1154,6 @@ fn link_autoref(rcx: &Rcx,
11561154
fn link_by_ref(rcx: &Rcx,
11571155
expr: &ast::Expr,
11581156
callee_scope: CodeExtent) {
1159-
let tcx = rcx.tcx();
11601157
debug!("link_by_ref(expr={}, callee_scope={:?})",
11611158
expr.repr(), callee_scope);
11621159
let mc = mc::MemCategorizationContext::new(rcx.fcx);

trunk/src/librustc_typeck/check/upvar.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ impl<'a,'tcx> AdjustBorrowKind<'a,'tcx> {
178178
AdjustBorrowKind { fcx: fcx, closures_with_inferred_kinds: closures_with_inferred_kinds }
179179
}
180180

181-
fn tcx(&self) -> &'a ty::ctxt<'tcx> {
182-
self.fcx.tcx()
183-
}
184-
185181
fn analyze_closure(&mut self, id: ast::NodeId, decl: &ast::FnDecl, body: &ast::Block) {
186182
/*!
187183
* Analysis starting point.

0 commit comments

Comments
 (0)