Skip to content

Commit 4741e2b

Browse files
committed
Remove fns from rust-lang#20664
1 parent 6e0408d commit 4741e2b

File tree

5 files changed

+7
-21
lines changed

5 files changed

+7
-21
lines changed

src/librustc/traits/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,10 @@ fn vtable_methods<'a, 'tcx>(
849849

850850
// the method may have some early-bound lifetimes, add
851851
// regions for those
852-
let substs = Substs::for_item(tcx, def_id,
853-
|_, _| tcx.types.re_erased,
854-
|def, _| trait_ref.substs().type_for_def(def));
852+
let substs = Substs::for_item(
853+
tcx, def_id,
854+
|_, _| tcx.types.re_erased,
855+
|def, _| trait_ref.skip_binder().substs.type_for_def(def));
855856

856857
// the trait type may have higher-ranked lifetimes in it;
857858
// so erase them if they appear, so that we get the type

src/librustc/traits/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
786786
// This suffices to allow chains like `FnMut` implemented in
787787
// terms of `Fn` etc, but we could probably make this more
788788
// precise still.
789-
let unbound_input_types = stack.fresh_trait_ref.input_types().any(|ty| ty.is_fresh());
789+
let unbound_input_types = stack.fresh_trait_ref.skip_binder().input_types().any(|ty| ty.is_fresh());
790790
// this check was an imperfect workaround for a bug n the old
791791
// intercrate mode, it should be removed when that goes away.
792792
if unbound_input_types &&

src/librustc/ty/sty.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,6 @@ impl<'tcx> PolyTraitRef<'tcx> {
574574
self.skip_binder().def_id
575575
}
576576

577-
pub fn substs(&self) -> &'tcx Substs<'tcx> {
578-
// FIXME(#20664) every use of this fn is probably a bug, it should yield Binder<>
579-
self.skip_binder().substs
580-
}
581-
582-
pub fn input_types<'a>(&'a self) -> impl DoubleEndedIterator<Item=Ty<'tcx>> + 'a {
583-
// FIXME(#20664) every use of this fn is probably a bug, it should yield Binder<>
584-
self.skip_binder().input_types()
585-
}
586-
587577
pub fn to_poly_trait_predicate(&self) -> ty::PolyTraitPredicate<'tcx> {
588578
// Note that we preserve binding levels
589579
Binder(ty::TraitPredicate { trait_ref: self.skip_binder().clone() })
@@ -635,11 +625,6 @@ impl<'tcx> PolyExistentialTraitRef<'tcx> {
635625
pub fn def_id(&self) -> DefId {
636626
self.skip_binder().def_id
637627
}
638-
639-
pub fn input_types<'a>(&'a self) -> impl DoubleEndedIterator<Item=Ty<'tcx>> + 'a {
640-
// FIXME(#20664) every use of this fn is probably a bug, it should yield Binder<>
641-
self.skip_binder().input_types()
642-
}
643628
}
644629

645630
/// Binder is a binder for higher-ranked lifetimes. It is part of the

src/librustc_typeck/check/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
303303
return None;
304304
}
305305

306-
let arg_param_ty = trait_ref.substs().type_at(1);
306+
let arg_param_ty = trait_ref.skip_binder().substs.type_at(1);
307307
let arg_param_ty = self.resolve_type_vars_if_possible(&arg_param_ty);
308308
debug!(
309309
"deduce_sig_from_projection: arg_param_ty {:?}",

src/librustc_typeck/check/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ impl<'tcx> Candidate<'tcx> {
14701470
// inference variables or other artifacts. This
14711471
// means they are safe to put into the
14721472
// `WhereClausePick`.
1473-
assert!(!trait_ref.substs().needs_infer());
1473+
assert!(!trait_ref.skip_binder().substs.needs_infer());
14741474

14751475
WhereClausePick(trait_ref.clone())
14761476
}

0 commit comments

Comments
 (0)