Skip to content

Commit 310f470

Browse files
committed
Make is_object_safe a method.
1 parent 6e15faf commit 310f470

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/librustc/query/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,6 @@ rustc_queries! {
653653
desc { |tcx| "building specialization graph of trait `{}`", tcx.def_path_str(key) }
654654
cache_on_disk_if { true }
655655
}
656-
query is_object_safe(key: DefId) -> bool {
657-
desc { |tcx| "determine object safety of trait `{}`", tcx.def_path_str(key) }
658-
}
659656
query object_safety_violations(key: DefId) -> Vec<traits::ObjectSafetyViolation> {
660657
desc { |tcx| "determine object safety of trait `{}`", tcx.def_path_str(key) }
661658
}

src/librustc/ty/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2998,6 +2998,10 @@ impl<'tcx> TyCtxt<'tcx> {
29982998
};
29992999
(ident, scope)
30003000
}
3001+
3002+
pub fn is_object_safe(self, key: DefId) -> bool {
3003+
self.object_safety_violations(key).is_empty()
3004+
}
30013005
}
30023006

30033007
#[derive(Clone, HashStable)]

src/librustc_incremental/persist/dirty_clean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const BASE_STRUCT: &[&str] =
7878
const BASE_TRAIT_DEF: &[&str] = &[
7979
label_strs::associated_item_def_ids,
8080
label_strs::generics_of,
81-
label_strs::is_object_safe,
81+
label_strs::object_safety_violations,
8282
label_strs::predicates_of,
8383
label_strs::specialization_graph_of,
8484
label_strs::trait_def,

src/librustc_infer/traits/object_safety.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,6 @@ fn contains_illegal_self_type_reference<'tcx>(
772772
error
773773
}
774774

775-
fn is_object_safe(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
776-
tcx.object_safety_violations(trait_def_id).is_empty()
777-
}
778-
779775
pub fn provide(providers: &mut ty::query::Providers<'_>) {
780-
*providers = ty::query::Providers { is_object_safe, object_safety_violations, ..*providers };
776+
*providers = ty::query::Providers { object_safety_violations, ..*providers };
781777
}

0 commit comments

Comments
 (0)