Skip to content

Commit b510ea1

Browse files
committed
Clean up unused argument/variable warnings.
1 parent a372755 commit b510ea1

File tree

20 files changed

+22
-54
lines changed

20 files changed

+22
-54
lines changed

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 {

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 {

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

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

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()

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>>>)

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);

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());

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);

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>>

0 commit comments

Comments
 (0)