]> git.proxmox.com Git - rustc.git/blame - tests/codegen/noalias-refcell.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / codegen / noalias-refcell.rs
CommitLineData
923072b8
FG
1// compile-flags: -O -C no-prepopulate-passes -Z mutable-noalias=yes
2
3#![crate_type = "lib"]
4
5use std::cell::{Ref, RefCell, RefMut};
6
7// Make sure that none of the arguments get a `noalias` attribute, because
8// the `RefCell` might alias writes after either `Ref`/`RefMut` is dropped.
9
10// CHECK-LABEL: @maybe_aliased(
11// CHECK-NOT: noalias
12// CHECK-SAME: %_refcell
13#[no_mangle]
14pub unsafe fn maybe_aliased(_: Ref<'_, i32>, _: RefMut<'_, i32>, _refcell: &RefCell<i32>) {}