move defining_opaque_types out of Canonical

This commit is contained in:
lcnr
2024-10-15 18:43:41 +02:00
parent 5834ba1ab7
commit 3360c1773a
25 changed files with 130 additions and 120 deletions

View File

@@ -60,7 +60,7 @@ where
(goal, opaque_types).fold_with(&mut EagerResolver::new(self.delegate));
let mut orig_values = Default::default();
let canonical_goal = Canonicalizer::canonicalize(
let canonical = Canonicalizer::canonicalize(
self.delegate,
CanonicalizeMode::Input,
&mut orig_values,
@@ -71,7 +71,11 @@ where
.mk_predefined_opaques_in_body(PredefinedOpaquesData { opaque_types }),
},
);
(orig_values, canonical_goal)
let query_input = ty::CanonicalQueryInput {
canonical,
defining_opaque_types: self.delegate.defining_opaque_types(),
};
(orig_values, query_input)
}
/// To return the constraints of a canonical query to the caller, we canonicalize:

View File

@@ -283,11 +283,11 @@ where
let mut ecx = EvalCtxt {
delegate,
variables: canonical_input.variables,
variables: canonical_input.canonical.variables,
var_values,
is_normalizes_to_goal: false,
predefined_opaques_in_body: input.predefined_opaques_in_body,
max_input_universe: canonical_input.max_universe,
max_input_universe: canonical_input.canonical.max_universe,
search_graph,
nested_goals: NestedGoals::new(),
tainted: Ok(()),

View File

@@ -313,6 +313,5 @@ fn response_no_constraints_raw<I: Interner>(
external_constraints: cx.mk_external_constraints(ExternalConstraintsData::default()),
certainty,
},
defining_opaque_types: Default::default(),
}
}

View File

@@ -96,14 +96,19 @@ where
}
fn step_is_coinductive(cx: I, input: CanonicalInput<I>) -> bool {
input.value.goal.predicate.is_coinductive(cx)
input.canonical.value.goal.predicate.is_coinductive(cx)
}
}
fn response_no_constraints<I: Interner>(
cx: I,
goal: CanonicalInput<I>,
input: CanonicalInput<I>,
certainty: Certainty,
) -> QueryResult<I> {
Ok(super::response_no_constraints_raw(cx, goal.max_universe, goal.variables, certainty))
Ok(super::response_no_constraints_raw(
cx,
input.canonical.max_universe,
input.canonical.variables,
certainty,
))
}