trait_sel: {Meta,Pointee}Sized on Sized types
Introduce the `MetaSized` and `PointeeSized` traits as supertraits of `Sized` and initially implement it on everything that currently implements `Sized` to isolate any changes that simply adding the traits introduces.
This commit is contained in:
@@ -89,6 +89,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
Some(LangItem::Sized) => {
|
||||
self.assemble_builtin_sized_candidate(obligation, &mut candidates);
|
||||
}
|
||||
Some(LangItem::MetaSized) => {
|
||||
self.assemble_builtin_sized_candidate(obligation, &mut candidates);
|
||||
}
|
||||
Some(LangItem::PointeeSized) => {
|
||||
self.assemble_builtin_sized_candidate(obligation, &mut candidates);
|
||||
}
|
||||
Some(LangItem::Unsize) => {
|
||||
self.assemble_candidates_for_unsizing(obligation, &mut candidates);
|
||||
}
|
||||
|
||||
@@ -252,6 +252,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
let trait_def = obligation.predicate.def_id();
|
||||
let conditions = match tcx.as_lang_item(trait_def) {
|
||||
Some(LangItem::Sized) => self.sized_conditions(obligation),
|
||||
Some(LangItem::MetaSized) => self.sized_conditions(obligation),
|
||||
Some(LangItem::PointeeSized) => self.sized_conditions(obligation),
|
||||
Some(LangItem::Copy | LangItem::Clone) => self.copy_clone_conditions(obligation),
|
||||
Some(LangItem::FusedIterator) => self.fused_iterator_conditions(obligation),
|
||||
other => bug!("unexpected builtin trait {trait_def:?} ({other:?})"),
|
||||
|
||||
Reference in New Issue
Block a user