]>
git.proxmox.com Git - rustc.git/blob - tests/codegen/drop-in-place-noalias.rs
1 // compile-flags: -O -C no-prepopulate-passes
3 // Tests that the compiler can apply `noalias` and other &mut attributes to `drop_in_place`.
4 // Note that non-Unpin types should not get `noalias`, matching &mut behavior.
8 use std
::marker
::PhantomPinned
;
10 // CHECK: define internal void @{{.*}}core{{.*}}ptr{{.*}}drop_in_place{{.*}}StructUnpin{{.*}}(ptr noalias noundef align 4 dereferenceable(12) %{{.+}})
12 // CHECK: define internal void @{{.*}}core{{.*}}ptr{{.*}}drop_in_place{{.*}}StructNotUnpin{{.*}}(ptr noundef nonnull align 4 %{{.+}})
14 pub struct StructUnpin
{
20 impl Drop
for StructUnpin
{
24 pub struct StructNotUnpin
{
31 impl Drop
for StructNotUnpin
{
35 pub unsafe fn main(x
: StructUnpin
, y
: StructNotUnpin
) {