summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2024-12-13 12:19:46 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2024-12-14 20:31:07 +0000
commit8a4e5d7444c4d43097c2ca0d1b8e64be9dbeddfa (patch)
treef9ca6a3756cf0bb0e520702d99f2064231e95223 /compiler/rustc_trait_selection/src
parent3a64bef2ba54542d3440634602e088c2597d9ed2 (diff)
downloadrust-8a4e5d7444c4d43097c2ca0d1b8e64be9dbeddfa.tar.gz
rust-8a4e5d7444c4d43097c2ca0d1b8e64be9dbeddfa.zip
Add some convenience helper methods on `hir::Safety`
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/misc.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/misc.rs b/compiler/rustc_trait_selection/src/traits/misc.rs
index d216ae72913..7a67b943e94 100644
--- a/compiler/rustc_trait_selection/src/traits/misc.rs
+++ b/compiler/rustc_trait_selection/src/traits/misc.rs
@@ -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);
     }