]> git.lizzy.rs Git - rust.git/blob - tests/codegen/noalias-refcell.rs
Auto merge of #106294 - Nilstrieb:noundef-everything, r=nikic
[rust.git] / tests / codegen / noalias-refcell.rs
1 // compile-flags: -O -C no-prepopulate-passes -Z mutable-noalias=yes
2
3 #![crate_type = "lib"]
4
5 use 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]
14 pub unsafe fn maybe_aliased(_: Ref<'_, i32>, _: RefMut<'_, i32>, _refcell: &RefCell<i32>) {}