Skip to content

Commit 0bd0b99

Browse files
committed
Use wide pointers consistenly across the compiler
1 parent d10a16a commit 0bd0b99

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

example/std_example.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fn main() {
168168

169169
foo(I64X2([0, 0]));
170170

171-
transmute_fat_pointer();
171+
transmute_wide_pointer();
172172

173173
rust_call_abi();
174174

@@ -192,7 +192,7 @@ type TwoPtrs = i64;
192192
#[cfg(target_pointer_width = "64")]
193193
type TwoPtrs = i128;
194194

195-
fn transmute_fat_pointer() -> TwoPtrs {
195+
fn transmute_wide_pointer() -> TwoPtrs {
196196
unsafe { transmute::<_, TwoPtrs>("true !") }
197197
}
198198

src/base.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -713,17 +713,17 @@ fn codegen_stmt<'tcx>(
713713
let from_ty = operand.layout().ty;
714714
let to_ty = fx.monomorphize(to_ty);
715715

716-
fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
716+
fn is_wide_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
717717
ty.builtin_deref(true)
718718
.is_some_and(|pointee_ty| has_ptr_meta(fx.tcx, pointee_ty))
719719
}
720720

721-
if is_fat_ptr(fx, from_ty) {
722-
if is_fat_ptr(fx, to_ty) {
723-
// fat-ptr -> fat-ptr
721+
if is_wide_ptr(fx, from_ty) {
722+
if is_wide_ptr(fx, to_ty) {
723+
// wide-ptr -> wide-ptr
724724
lval.write_cvalue(fx, operand.cast_pointer_to(dest_layout));
725725
} else {
726-
// fat-ptr -> thin-ptr
726+
// wide-ptr -> thin-ptr
727727
let (ptr, _extra) = operand.load_scalar_pair(fx);
728728
lval.write_cvalue(fx, CValue::by_val(ptr, dest_layout))
729729
}

src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn clif_pair_type_from_ty<'tcx>(
101101
})
102102
}
103103

104-
/// Is a pointer to this type a fat ptr?
104+
/// Is a pointer to this type a wide ptr?
105105
pub(crate) fn has_ptr_meta<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
106106
if ty.is_sized(tcx, ParamEnv::reveal_all()) {
107107
return false;

src/debuginfo/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl DebugContext {
139139

140140
pointer_type_id
141141
} else {
142-
// FIXME implement debuginfo for fat pointers
142+
// FIXME implement debuginfo for wide pointers
143143
self.placeholder_for_type(tcx, type_dbg, ptr_type)
144144
}
145145
}

0 commit comments

Comments
 (0)