Make Binder's field private and clean up its usage
This commit is contained in:
parent
190a6c41cf
commit
98546f8b26
48 changed files with 262 additions and 234 deletions
|
@ -286,7 +286,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
|||
substs: tcx.mk_substs_trait(ty, &[]),
|
||||
};
|
||||
|
||||
let trait_pred = ty::Binder(trait_ref);
|
||||
let trait_pred = ty::Binder::bind(trait_ref);
|
||||
|
||||
let bail_out = tcx.infer_ctxt().enter(|infcx| {
|
||||
let mut selcx = SelectionContext::with_negative(&infcx, true);
|
||||
|
@ -622,7 +622,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
|||
|
||||
let mut already_visited = FxHashSet();
|
||||
let mut predicates = VecDeque::new();
|
||||
predicates.push_back(ty::Binder(ty::TraitPredicate {
|
||||
predicates.push_back(ty::Binder::bind(ty::TraitPredicate {
|
||||
trait_ref: ty::TraitRef {
|
||||
def_id: trait_did,
|
||||
substs: infcx.tcx.mk_substs_trait(ty, &[]),
|
||||
|
|
|
@ -120,7 +120,7 @@ impl<T: Clean<U>, U> Clean<Option<U>> for Option<T> {
|
|||
|
||||
impl<T, U> Clean<U> for ty::Binder<T> where T: Clean<U> {
|
||||
fn clean(&self, cx: &DocContext) -> U {
|
||||
self.0.clean(cx)
|
||||
self.skip_binder().clean(cx)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2846,15 +2846,15 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
|
|||
}
|
||||
|
||||
let mut bindings = vec![];
|
||||
for ty::Binder(ref pb) in obj.projection_bounds() {
|
||||
for pb in obj.projection_bounds() {
|
||||
bindings.push(TypeBinding {
|
||||
name: cx.tcx.associated_item(pb.item_def_id).name.clean(cx),
|
||||
ty: pb.ty.clean(cx)
|
||||
name: cx.tcx.associated_item(pb.item_def_id()).name.clean(cx),
|
||||
ty: pb.skip_binder().ty.clean(cx)
|
||||
});
|
||||
}
|
||||
|
||||
let path = external_path(cx, &cx.tcx.item_name(did), Some(did),
|
||||
false, bindings, principal.0.substs);
|
||||
false, bindings, principal.skip_binder().substs);
|
||||
ResolvedPath {
|
||||
path,
|
||||
typarams: Some(typarams),
|
||||
|
|
|
@ -154,7 +154,7 @@ fn trait_is_same_or_supertrait(cx: &DocContext, child: DefId,
|
|||
let predicates = cx.tcx.super_predicates_of(child).predicates;
|
||||
predicates.iter().filter_map(|pred| {
|
||||
if let ty::Predicate::Trait(ref pred) = *pred {
|
||||
if pred.0.trait_ref.self_ty().is_self() {
|
||||
if pred.skip_binder().trait_ref.self_ty().is_self() {
|
||||
Some(pred.def_id())
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue