Skip to content

Commit 048a801

Browse files
committed
UnsafeCell -> RwLock
1 parent 43c6f9c commit 048a801

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/codegen/noalias-rwlockreadguard.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
#![crate_type = "lib"]
44

5-
use std::cell::UnsafeCell;
6-
use std::sync::RwLockReadGuard;
5+
use std::sync::{RwLock, RwLockReadGuard};
76

87
// Make sure that `RwLockReadGuard` does not get a `noalias` attribute, because
9-
// the `UnsafeCell` might alias writes after it is dropped.
8+
// the `RwLock` might alias writes after it is dropped.
109

1110
// CHECK-LABEL: @maybe_aliased(
1211
// CHECK-NOT: noalias
1312
// CHECK-SAME: %_data
1413
#[no_mangle]
15-
pub unsafe fn maybe_aliased(_: RwLockReadGuard<'_, i32>, _data: &UnsafeCell<i32>) {}
14+
pub unsafe fn maybe_aliased(_: RwLockReadGuard<'_, i32>, _data: &RwLock<i32>) {}

0 commit comments

Comments
 (0)