Skip to content

Commit 9be155d

Browse files
committed
remove the hacky selection impl in method::probe
1 parent fceab9f commit 9be155d

File tree

7 files changed

+120
-438
lines changed

7 files changed

+120
-438
lines changed

src/librustc_typeck/check/method/confirm.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,24 +232,6 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
232232
})
233233
}
234234

235-
probe::ExtensionImplPick(impl_def_id) => {
236-
// The method being invoked is the method as defined on the trait,
237-
// so return the substitutions from the trait. Consider:
238-
//
239-
// impl<A,B,C> Trait<A,B> for Foo<C> { ... }
240-
//
241-
// If we instantiate A, B, and C with $A, $B, and $C
242-
// respectively, then we want to return the type
243-
// parameters from the trait ([$A,$B]), not those from
244-
// the impl ([$A,$B,$C]) not the receiver type ([$C]).
245-
let impl_polytype = self.impl_self_ty(self.span, impl_def_id);
246-
let impl_trait_ref =
247-
self.instantiate_type_scheme(self.span,
248-
impl_polytype.substs,
249-
&self.tcx.impl_trait_ref(impl_def_id).unwrap());
250-
impl_trait_ref.substs
251-
}
252-
253235
probe::TraitPick => {
254236
let trait_def_id = pick.item.container.id();
255237

src/librustc_typeck/check/method/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ pub enum MethodError<'tcx> {
5252
// Multiple methods might apply.
5353
Ambiguity(Vec<CandidateSource>),
5454

55-
// Using a `Fn`/`FnMut`/etc method on a raw closure type before we have inferred its kind.
56-
ClosureAmbiguity(// DefId of fn trait
57-
DefId),
58-
5955
// Found an applicable method, but it is not visible. The second argument contains a list of
6056
// not-in-scope traits which may work.
6157
PrivateMatch(Def, Vec<DefId>),
@@ -113,7 +109,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
113109
Ok(..) => true,
114110
Err(NoMatch(..)) => false,
115111
Err(Ambiguity(..)) => true,
116-
Err(ClosureAmbiguity(..)) => true,
117112
Err(PrivateMatch(..)) => allow_private,
118113
Err(IllegalSizedBound(..)) => true,
119114
}

0 commit comments

Comments
 (0)