) -> SubstsRef<'tcx> {
match pick.kind {
probe::InherentImplPick => {
- let impl_def_id = pick.item.container.id();
+ let impl_def_id = pick.item.container_id(self.tcx);
assert!(
self.tcx.impl_trait_ref(impl_def_id).is_none(),
"impl {:?} is not an inherent impl",
}
probe::ObjectPick => {
- let trait_def_id = pick.item.container.id();
+ let trait_def_id = pick.item.container_id(self.tcx);
self.extract_existential_trait_ref(self_ty, |this, object_ty, principal| {
// The object data has no entry for the Self
// Type. For the purposes of this method call, we
}
probe::TraitPick => {
- let trait_def_id = pick.item.container.id();
+ let trait_def_id = pick.item.container_id(self.tcx);
// Make a trait reference `$0 : Trait<$1...$n>`
// consisting entirely of type variables. Later on in
fn enforce_illegal_method_limitations(&self, pick: &probe::Pick<'_>) {
// Disallow calls to the method `drop` defined in the `Drop` trait.
- match pick.item.container {
- ty::TraitContainer(trait_def_id) => callee::check_legal_trait_for_method_call(
+ if let Some(trait_def_id) = pick.item.trait_container(self.tcx) {
+ callee::check_legal_trait_for_method_call(
self.tcx,
self.span,
Some(self.self_expr.span),
self.call_expr.span,
trait_def_id,
- ),
- ty::ImplContainer(..) => {}
+ )
}
}