1
Fork 0

Only prefer Sized candidates, and only if they certainly hold

This commit is contained in:
Michael Goulet 2025-03-10 16:50:29 +00:00
parent f9696dda6e
commit aebbd42460
7 changed files with 89 additions and 23 deletions

View file

@ -95,8 +95,11 @@ pub type EvaluationCache<'tcx, ENV> = Cache<(ENV, ty::PolyTraitPredicate<'tcx>),
/// parameter environment.
#[derive(PartialEq, Eq, Debug, Clone, TypeVisitable)]
pub enum SelectionCandidate<'tcx> {
/// UwU
SizedCandidate,
/// A built-in implementation for the `Sized` trait. This is preferred
/// over all other candidates.
SizedCandidate {
has_nested: bool,
},
/// A builtin implementation for some specific traits, used in cases
/// where we cannot rely an ordinary library implementations.