Skip to content

Commit 62b0da6

Browse files
committed
Fix futures_ambiguity test
1 parent ea15431 commit 62b0da6

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

chalk-solve/src/clauses.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ fn program_clauses_that_could_match<I: Interner>(
278278
match_ty(builder, environment, ty)?
279279
}
280280
DomainGoal::FromEnv(_) => (), // Computed in the environment
281-
DomainGoal::Normalize(Normalize { alias, ty }) => {
281+
DomainGoal::Normalize(Normalize { alias, ty: _ }) => {
282282
// Normalize goals derive from `AssociatedTyValue` datums,
283283
// which are found in impls. That is, if we are
284284
// normalizing (e.g.) `<T as Iterator>::Item>`, then
@@ -294,25 +294,6 @@ fn program_clauses_that_could_match<I: Interner>(
294294
let trait_id = associated_ty_datum.trait_id;
295295
let trait_parameters = db.trait_parameters_from_projection(alias);
296296

297-
if let TyData::Apply(ApplicationTy {
298-
name: TypeName::AssociatedType(_),
299-
..
300-
}) = ty.data(interner)
301-
{
302-
// TODO this is probably wrong
303-
// Associated types will never *normalize* to an associated type placeholder.
304-
// It's important that we return early here so that we don't flounder in this case.
305-
return Some(());
306-
}
307-
308-
let trait_datum = builder.db.trait_datum(trait_id);
309-
if trait_datum.is_non_enumerable_trait() || trait_datum.is_auto_trait() {
310-
let self_ty = alias.self_type_parameter(interner);
311-
if self_ty.bound(interner).is_some() || self_ty.inference_var(interner).is_some() {
312-
return None;
313-
}
314-
}
315-
316297
push_program_clauses_for_associated_type_values_in_impls_of(
317298
builder,
318299
trait_id,

chalk-solve/src/recursive/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,14 @@ impl<'me, I: Interner> Solver<'me, I> {
333333
self.context.search_graph[dfn].solution_priority,
334334
current_prio,
335335
) == (ClausePriority::High, ClausePriority::Low)
336+
&& self.context.search_graph[dfn].solution.is_ok()
336337
{
337338
// TODO check solution inputs?
338339
// Not replacing the current answer, so we're at a fixed point?
339-
debug!("solve_new_subgoal: new answer has lower priority");
340+
debug!(
341+
"solve_new_subgoal: new answer has lower priority (old answer: {:?})",
342+
self.context.search_graph[dfn].solution
343+
);
340344
return *minimums;
341345
}
342346

0 commit comments

Comments
 (0)