Use a query rather than recomputing the tail repeatedly

This commit is contained in:
Michael Goulet
2025-03-30 03:40:14 +00:00
parent ccdfd310be
commit 830aeb6102
13 changed files with 234 additions and 90 deletions

View File

@@ -1026,6 +1026,13 @@ rustc_queries! {
separate_provide_extern
}
/// Given an `impl_def_id`, return true if the self type is guaranteed to be unsized due
/// to either being one of the built-in unsized types (str/slice/dyn) or to be a struct
/// whose tail is one of those types.
query impl_self_is_guaranteed_unsized(impl_def_id: DefId) -> bool {
desc { |tcx| "computing whether `{}` has a guaranteed unsized self type", tcx.def_path_str(impl_def_id) }
}
/// Maps a `DefId` of a type to a list of its inherent impls.
/// Contains implementations of methods that are inherent to a type.
/// Methods in these implementations don't need to be exported.