about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-12 23:18:14 +0000
committerbors <bors@rust-lang.org>2025-02-12 23:18:14 +0000
commit159080c92ec8afe5b88292decba447f099c8a75d (patch)
tree227d9b659ea17b09ffc2f53f20ec0e151285db35
parent603534fbf4dc9f70a37f9389c0b7a336d8010499 (diff)
parent732132f6b1972a65b4ae59da57dda10d5272f8a2 (diff)
downloadrust-159080c92ec8afe5b88292decba447f099c8a75d.tar.gz
rust-159080c92ec8afe5b88292decba447f099c8a75d.zip
Auto merge of #135994 - 1c3t3a:rename-unsafe-ptr, r=oli-obk
Rename rustc_middle::Ty::is_unsafe_ptr to is_raw_ptr

The wording unsafe pointer is less common and not mentioned in a lot of places, instead this is usually called a "raw pointer". For the sake of uniformity, we rename this method.
This came up during the review of
https://github.com/rust-lang/rust/pull/134424.

r? `@Noratrieb`
-rw-r--r--src/base.rs4
-rw-r--r--src/vtable.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/base.rs b/src/base.rs
index a2b9e5712e5..125a9201831 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -900,8 +900,8 @@ fn codegen_stmt<'tcx>(
                     };
                     let data = codegen_operand(fx, data);
                     let meta = codegen_operand(fx, meta);
-                    assert!(data.layout().ty.is_unsafe_ptr());
-                    assert!(layout.ty.is_unsafe_ptr());
+                    assert!(data.layout().ty.is_raw_ptr());
+                    assert!(layout.ty.is_raw_ptr());
                     let ptr_val = if meta.layout().is_zst() {
                         data.cast_pointer_to(layout)
                     } else {
diff --git a/src/vtable.rs b/src/vtable.rs
index a460023b59c..9d9e0462a9b 100644
--- a/src/vtable.rs
+++ b/src/vtable.rs
@@ -48,7 +48,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
 ) -> (Pointer, Value) {
     let (ptr, vtable) = 'block: {
         if let BackendRepr::Scalar(_) = arg.layout().backend_repr {
-            while !arg.layout().ty.is_unsafe_ptr() && !arg.layout().ty.is_ref() {
+            while !arg.layout().ty.is_raw_ptr() && !arg.layout().ty.is_ref() {
                 let (idx, _) = arg
                     .layout()
                     .non_1zst_field(fx)