]> git.lizzy.rs Git - rust.git/blob - tests/codegen/noalias-unpin.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / codegen / noalias-unpin.rs
1 // compile-flags: -O -Z mutable-noalias=yes
2
3 #![crate_type = "lib"]
4
5 pub struct SelfRef {
6     self_ref: *mut SelfRef,
7     _pin: std::marker::PhantomPinned
8 }
9
10 // CHECK-LABEL: @test_self_ref(
11 // CHECK-NOT: noalias
12 #[no_mangle]
13 pub unsafe fn test_self_ref(s: &mut SelfRef) {
14     (*s.self_ref).self_ref = std::ptr::null_mut();
15 }