1
Fork 0

Auto merge of #114457 - lcnr:trait_ref_is_knowable-normalize, r=compiler-errors

normalize in `trait_ref_is_knowable` in new solver

fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/51

Alternatively we could avoid normalizing the self type and do this at the end of the `assemble_candidates_via_self_ty` stack by splitting candidates into:
- applicable without normalizing self type
- applicable for aliases, even if they can be normalized
- applicable for stuff which cannot get normalized further

I don't think this would have any significant benefits and it also seems non-trivial to avoid normalizing only the self type in `trait_ref_is_knowable`.

r? `@compiler-errors`
This commit is contained in:
bors 2023-08-13 05:18:27 +00:00
commit 7455aa5395
12 changed files with 270 additions and 119 deletions

View file

@ -1457,7 +1457,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// bound regions.
let trait_ref = predicate.skip_binder().trait_ref;
coherence::trait_ref_is_knowable(self.tcx(), trait_ref)
coherence::trait_ref_is_knowable::<!>(self.tcx(), trait_ref, |ty| Ok(ty)).unwrap()
}
/// Returns `true` if the global caches can be used.