1
Fork 0

Add some convenience helper methods on hir::Safety

This commit is contained in:
Oli Scherer 2024-12-13 12:19:46 +00:00
parent 3a64bef2ba
commit 8a4e5d7444
27 changed files with 72 additions and 68 deletions

View file

@ -84,7 +84,7 @@ pub fn type_allowed_to_implement_copy<'tcx>(
return Err(CopyImplementationError::HasDestructor);
}
if impl_safety == hir::Safety::Safe && self_type.has_unsafe_fields() {
if impl_safety.is_safe() && self_type.has_unsafe_fields() {
return Err(CopyImplementationError::HasUnsafeFields);
}