mark candidate set ambig for defaulted traits where self-type is not yet known
This commit is contained in:
parent
24bdce4bbf
commit
e8df95d77f
1 changed files with 6 additions and 1 deletions
|
|
@ -1143,8 +1143,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}
|
||||
|
||||
match self_ty.sty {
|
||||
ty::ty_infer(ty::TyVar(_)) |
|
||||
ty::ty_trait(..) => {},
|
||||
ty::ty_infer(ty::TyVar(_)) => {
|
||||
// the defaulted impl might apply, we don't know
|
||||
if ty::trait_has_default_impl(self.tcx(), def_id) {
|
||||
candidates.ambiguous = true;
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if ty::trait_has_default_impl(self.tcx(), def_id) {
|
||||
candidates.vec.push(DefaultImplCandidate(def_id.clone()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue