It's not about types or consts, but the lack of regions
This commit is contained in:
@@ -174,7 +174,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
|
||||
debug!(?stack, ?candidates, "winnowed to {} candidates", candidates.len());
|
||||
|
||||
let needs_infer = stack.obligation.predicate.has_infer_types_or_consts();
|
||||
let needs_infer = stack.obligation.predicate.has_non_region_infer();
|
||||
|
||||
// If there are STILL multiple candidates, we can further
|
||||
// reduce the list by dropping duplicates -- including
|
||||
@@ -889,11 +889,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
candidates: &mut SelectionCandidateSet<'tcx>,
|
||||
) {
|
||||
if obligation.has_param_types_or_consts() {
|
||||
if obligation.has_non_region_param() {
|
||||
return;
|
||||
}
|
||||
|
||||
if obligation.has_infer_types_or_consts() {
|
||||
if obligation.has_non_region_infer() {
|
||||
candidates.ambiguous = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
)
|
||||
}
|
||||
(Err(ErrorHandled::TooGeneric), _) | (_, Err(ErrorHandled::TooGeneric)) => {
|
||||
if c1.has_infer_types_or_consts() || c2.has_infer_types_or_consts() {
|
||||
if c1.has_non_region_infer() || c2.has_non_region_infer() {
|
||||
Ok(EvaluatedToAmbig)
|
||||
} else {
|
||||
// Two different constants using generic parameters ~> error.
|
||||
@@ -1520,7 +1520,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
if !generics.params.is_empty()
|
||||
&& obligation.predicate.substs[generics.parent_count..]
|
||||
.iter()
|
||||
.any(|&p| p.has_infer_types_or_consts() && self.infcx.shallow_resolve(p) != p)
|
||||
.any(|&p| p.has_non_region_infer() && self.infcx.shallow_resolve(p) != p)
|
||||
{
|
||||
ProjectionMatchesProjection::Ambiguous
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user