Skip to content

Commit 159080c

Browse files
committed
Auto merge of rust-lang#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 rust-lang#134424. r? `@Noratrieb`
2 parents 603534f + 732132f commit 159080c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,8 @@ fn codegen_stmt<'tcx>(
900900
};
901901
let data = codegen_operand(fx, data);
902902
let meta = codegen_operand(fx, meta);
903-
assert!(data.layout().ty.is_unsafe_ptr());
904-
assert!(layout.ty.is_unsafe_ptr());
903+
assert!(data.layout().ty.is_raw_ptr());
904+
assert!(layout.ty.is_raw_ptr());
905905
let ptr_val = if meta.layout().is_zst() {
906906
data.cast_pointer_to(layout)
907907
} else {

src/vtable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
4848
) -> (Pointer, Value) {
4949
let (ptr, vtable) = 'block: {
5050
if let BackendRepr::Scalar(_) = arg.layout().backend_repr {
51-
while !arg.layout().ty.is_unsafe_ptr() && !arg.layout().ty.is_ref() {
51+
while !arg.layout().ty.is_raw_ptr() && !arg.layout().ty.is_ref() {
5252
let (idx, _) = arg
5353
.layout()
5454
.non_1zst_field(fx)

0 commit comments

Comments
 (0)