Make all generics_require_sized_self go through the query to get caching.
This commit is contained in:
parent
ce3cff47e0
commit
307b5ffff3
1 changed files with 3 additions and 3 deletions
|
@ -101,7 +101,7 @@ pub fn is_vtable_safe_method(tcx: TyCtxt<'_>, trait_def_id: DefId, method: ty::A
|
||||||
debug_assert!(tcx.generics_of(trait_def_id).has_self);
|
debug_assert!(tcx.generics_of(trait_def_id).has_self);
|
||||||
debug!("is_vtable_safe_method({:?}, {:?})", trait_def_id, method);
|
debug!("is_vtable_safe_method({:?}, {:?})", trait_def_id, method);
|
||||||
// Any method that has a `Self: Sized` bound cannot be called.
|
// Any method that has a `Self: Sized` bound cannot be called.
|
||||||
if generics_require_sized_self(tcx, method.def_id) {
|
if tcx.generics_require_sized_self(method.def_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ fn super_predicates_have_non_lifetime_binders(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn trait_has_sized_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
|
fn trait_has_sized_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
|
||||||
generics_require_sized_self(tcx, trait_def_id)
|
tcx.generics_require_sized_self(trait_def_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
||||||
|
@ -364,7 +364,7 @@ fn object_safety_violation_for_assoc_item(
|
||||||
) -> Option<ObjectSafetyViolation> {
|
) -> Option<ObjectSafetyViolation> {
|
||||||
// Any item that has a `Self : Sized` requisite is otherwise
|
// Any item that has a `Self : Sized` requisite is otherwise
|
||||||
// exempt from the regulations.
|
// exempt from the regulations.
|
||||||
if generics_require_sized_self(tcx, item.def_id) {
|
if tcx.generics_require_sized_self(item.def_id) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue