UnsafeCell -> RwLock
This commit is contained in:
parent
43c6f9c691
commit
048a80140b
1 changed files with 3 additions and 4 deletions
|
@ -2,14 +2,13 @@
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
use std::cell::UnsafeCell;
|
use std::sync::{RwLock, RwLockReadGuard};
|
||||||
use std::sync::RwLockReadGuard;
|
|
||||||
|
|
||||||
// Make sure that `RwLockReadGuard` does not get a `noalias` attribute, because
|
// Make sure that `RwLockReadGuard` does not get a `noalias` attribute, because
|
||||||
// the `UnsafeCell` might alias writes after it is dropped.
|
// the `RwLock` might alias writes after it is dropped.
|
||||||
|
|
||||||
// CHECK-LABEL: @maybe_aliased(
|
// CHECK-LABEL: @maybe_aliased(
|
||||||
// CHECK-NOT: noalias
|
// CHECK-NOT: noalias
|
||||||
// CHECK-SAME: %_data
|
// CHECK-SAME: %_data
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe fn maybe_aliased(_: RwLockReadGuard<'_, i32>, _data: &UnsafeCell<i32>) {}
|
pub unsafe fn maybe_aliased(_: RwLockReadGuard<'_, i32>, _data: &RwLock<i32>) {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue