Compiler: Rename "object safe" to "dyn compatible"
This commit is contained in:
parent
f5cd2c5888
commit
01a063f9df
183 changed files with 523 additions and 510 deletions
|
@ -639,8 +639,8 @@ where
|
|||
ty::Dynamic(bounds, ..) => bounds,
|
||||
};
|
||||
|
||||
// Do not consider built-in object impls for non-object-safe types.
|
||||
if bounds.principal_def_id().is_some_and(|def_id| !cx.trait_is_object_safe(def_id)) {
|
||||
// Do not consider built-in object impls for dyn-incompatible types.
|
||||
if bounds.principal_def_id().is_some_and(|def_id| !cx.trait_is_dyn_compatible(def_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -423,8 +423,8 @@ where
|
|||
ty::PredicateKind::Coerce(predicate) => {
|
||||
self.compute_coerce_goal(Goal { param_env, predicate })
|
||||
}
|
||||
ty::PredicateKind::ObjectSafe(trait_def_id) => {
|
||||
self.compute_object_safe_goal(trait_def_id)
|
||||
ty::PredicateKind::DynCompatible(trait_def_id) => {
|
||||
self.compute_dyn_compatible_goal(trait_def_id)
|
||||
}
|
||||
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => {
|
||||
self.compute_well_formed_goal(Goal { param_env, predicate: arg })
|
||||
|
|
|
@ -111,8 +111,8 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn compute_object_safe_goal(&mut self, trait_def_id: I::DefId) -> QueryResult<I> {
|
||||
if self.cx().trait_is_object_safe(trait_def_id) {
|
||||
fn compute_dyn_compatible_goal(&mut self, trait_def_id: I::DefId) -> QueryResult<I> {
|
||||
if self.cx().trait_is_dyn_compatible(trait_def_id) {
|
||||
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
|
||||
} else {
|
||||
Err(NoSolution)
|
||||
|
|
|
@ -832,8 +832,8 @@ where
|
|||
let cx = self.cx();
|
||||
let Goal { predicate: (a_ty, _), .. } = goal;
|
||||
|
||||
// Can only unsize to an object-safe trait.
|
||||
if b_data.principal_def_id().is_some_and(|def_id| !cx.trait_is_object_safe(def_id)) {
|
||||
// Can only unsize to an dyn-compatible trait.
|
||||
if b_data.principal_def_id().is_some_and(|def_id| !cx.trait_is_dyn_compatible(def_id)) {
|
||||
return Err(NoSolution);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue