From f97679d6ba93ee83dec42a76b804483ddfbd2e11 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sun, 9 Feb 2025 23:10:29 -0800 Subject: [PATCH 1/3] cg_clif: stop worrying about `Conv::PtxKernel` --- src/abi/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/abi/mod.rs b/src/abi/mod.rs index fdcd9caf4ac8..756a2226753f 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -65,11 +65,7 @@ pub(crate) fn conv_to_call_conv(sess: &Session, c: Conv, default_call_conv: Call sess.dcx().fatal("C-cmse-nonsecure-entry call conv is not yet implemented"); } - Conv::Msp430Intr - | Conv::PtxKernel - | Conv::GpuKernel - | Conv::AvrInterrupt - | Conv::AvrNonBlockingInterrupt => { + Conv::Msp430Intr | Conv::GpuKernel | Conv::AvrInterrupt | Conv::AvrNonBlockingInterrupt => { unreachable!("tried to use {c:?} call conv which only exists on an unsupported target"); } } From 732132f6b1972a65b4ae59da57dda10d5272f8a2 Mon Sep 17 00:00:00 2001 From: Bastian Kersting Date: Fri, 24 Jan 2025 14:58:33 +0000 Subject: [PATCH 2/3] Extend the renaming to coerce_unsafe_ptr --- src/base.rs | 4 ++-- src/vtable.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base.rs b/src/base.rs index a2b9e5712e50..125a9201831c 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 a460023b59cb..9d9e0462a9b7 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) From c6ddd335a833ebced8de60724b2ff94323a9c5ac Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 6 Feb 2025 20:08:29 +0000 Subject: [PATCH 3/3] Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validity --- example/mini_core.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/mini_core.rs b/example/mini_core.rs index a0a381638c06..79820232496a 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -57,6 +57,9 @@ impl LegacyReceiver for Box {} #[lang = "copy"] pub trait Copy {} +#[lang = "bikeshed_guaranteed_no_drop"] +pub trait BikeshedGuaranteedNoDrop {} + impl Copy for bool {} impl Copy for u8 {} impl Copy for u16 {}