1
Fork 0

Make is_object_safe a query and move lint_object_unsafe_trait call there

This commit is contained in:
Gary Guo 2022-12-29 09:53:25 +00:00
parent e144a13254
commit d6de40b536
3 changed files with 35 additions and 18 deletions

View file

@ -1274,6 +1274,9 @@ rustc_queries! {
query object_safety_violations(trait_id: DefId) -> &'tcx [traits::ObjectSafetyViolation] {
desc { |tcx| "determining object safety of trait `{}`", tcx.def_path_str(trait_id) }
}
query is_object_safe(trait_id: DefId) -> bool {
desc { |tcx| "determining object safety of trait `{}`", tcx.def_path_str(trait_id) }
}
/// Gets the ParameterEnvironment for a given item; this environment
/// will be in "user-facing" mode, meaning that it is suitable for