Remove Clean trait implementation for ty::TraitRef
This commit is contained in:
parent
482153bc20
commit
fa14d02d9b
@ -120,7 +120,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
|
||||
kind: Box::new(ImplItem(Box::new(Impl {
|
||||
unsafety: hir::Unsafety::Normal,
|
||||
generics: new_generics,
|
||||
trait_: Some(trait_ref.clean(self.cx)),
|
||||
trait_: Some(clean_trait_ref_with_bindings(self.cx, trait_ref, &[])),
|
||||
for_: clean_middle_ty(ty, self.cx, None),
|
||||
items: Vec::new(),
|
||||
polarity,
|
||||
|
@ -115,7 +115,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
|
||||
),
|
||||
// FIXME(eddyb) compute both `trait_` and `for_` from
|
||||
// the post-inference `trait_ref`, as it's more accurate.
|
||||
trait_: Some(trait_ref.0.clean(cx)),
|
||||
trait_: Some(clean_trait_ref_with_bindings(cx, trait_ref.0, &[])),
|
||||
for_: clean_middle_ty(ty.0, cx, None),
|
||||
items: cx.tcx
|
||||
.associated_items(impl_def_id)
|
||||
|
@ -16,9 +16,9 @@ use rustc_span::hygiene::MacroKind;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
|
||||
use crate::clean::{
|
||||
self, clean_fn_decl_from_did_and_sig, clean_middle_field, clean_middle_ty, clean_ty,
|
||||
clean_ty_generics, clean_variant_def, clean_visibility, utils, Attributes, AttributesExt,
|
||||
Clean, ImplKind, ItemId, Type, Visibility,
|
||||
self, clean_fn_decl_from_did_and_sig, clean_middle_field, clean_middle_ty,
|
||||
clean_trait_ref_with_bindings, clean_ty, clean_ty_generics, clean_variant_def,
|
||||
clean_visibility, utils, Attributes, AttributesExt, Clean, ImplKind, ItemId, Type, Visibility,
|
||||
};
|
||||
use crate::core::DocContext;
|
||||
use crate::formats::item_type::ItemType;
|
||||
@ -450,7 +450,7 @@ pub(crate) fn build_impl(
|
||||
),
|
||||
};
|
||||
let polarity = tcx.impl_polarity(did);
|
||||
let trait_ = associated_trait.map(|t| t.clean(cx));
|
||||
let trait_ = associated_trait.map(|t| clean_trait_ref_with_bindings(cx, t, &[]));
|
||||
if trait_.as_ref().map(|t| t.def_id()) == tcx.lang_items().deref_trait() {
|
||||
super::build_deref_target_impls(cx, &trait_items, ret);
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ impl<'tcx> Clean<'tcx, Option<GenericBound>> for hir::GenericBound<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn clean_trait_ref_with_bindings<'tcx>(
|
||||
pub(crate) fn clean_trait_ref_with_bindings<'tcx>(
|
||||
cx: &mut DocContext<'tcx>,
|
||||
trait_ref: ty::TraitRef<'tcx>,
|
||||
bindings: &[TypeBinding],
|
||||
@ -180,12 +180,6 @@ fn clean_trait_ref_with_bindings<'tcx>(
|
||||
path
|
||||
}
|
||||
|
||||
impl<'tcx> Clean<'tcx, Path> for ty::TraitRef<'tcx> {
|
||||
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
|
||||
clean_trait_ref_with_bindings(cx, *self, &[])
|
||||
}
|
||||
}
|
||||
|
||||
fn clean_poly_trait_ref_with_bindings<'tcx>(
|
||||
cx: &mut DocContext<'tcx>,
|
||||
poly_trait_ref: ty::PolyTraitRef<'tcx>,
|
||||
@ -432,7 +426,7 @@ fn clean_projection<'tcx>(
|
||||
def_id: Option<DefId>,
|
||||
) -> Type {
|
||||
let lifted = ty.lift_to_tcx(cx.tcx).unwrap();
|
||||
let trait_ = lifted.trait_ref(cx.tcx).clean(cx);
|
||||
let trait_ = clean_trait_ref_with_bindings(cx, lifted.trait_ref(cx.tcx), &[]);
|
||||
let self_type = clean_middle_ty(ty.self_ty(), cx, None);
|
||||
let self_def_id = if let Some(def_id) = def_id {
|
||||
cx.tcx.opt_parent(def_id).or(Some(def_id))
|
||||
|
Loading…
x
Reference in New Issue
Block a user