trait CanonicalizeMode {
// Required methods
fn canonicalize_free_region<'tcx>(
&self,
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
r: Region<'tcx>,
) -> Region<'tcx>;
fn any(&self) -> bool;
fn preserve_universes(&self) -> bool;
}
Expand description
Controls how we canonicalize “free regions” that are not inference variables. This depends on what we are canonicalizing for – e.g., if we are canonicalizing to create a query, we want to replace those with inference variables, since we want to make a maximally general query. But if we are canonicalizing a query response, then we don’t typically replace free regions, as they must have been introduced from other parts of the system.