address nits

This commit is contained in:
Lukas Markeffsky
2024-03-18 22:28:29 +01:00
parent ee66acbea8
commit 99efae342e
4 changed files with 18 additions and 17 deletions

View File

@@ -2118,11 +2118,14 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
),
ty::Adt(def, args) => {
let sized_crit = def.sized_constraint(self.tcx());
// (*) binder moved here
Where(obligation.predicate.rebind(
sized_crit.map_or_else(Vec::new, |ty| vec![ty.instantiate(self.tcx(), args)]),
))
if let Some(sized_crit) = def.sized_constraint(self.tcx()) {
// (*) binder moved here
Where(
obligation.predicate.rebind(vec![sized_crit.instantiate(self.tcx(), args)]),
)
} else {
Where(ty::Binder::dummy(Vec::new()))
}
}
ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => None,