forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 473
Closed
Labels
good first issueGood for newcomersGood for newcomersunsoundThe possibility of UB in safe code.The possibility of UB in safe code.• driversRelated to the example drivers in `drivers/`.Related to the example drivers in `drivers/`.
Description
In rust_miscdev, this would compile:
let mut state = SharedState::try_new()?;
let mut state2 = SharedState::try_new()?;
core::mem::swap(Arc::get_mut(&mut state).unwrap(), Arc::get_mut(&mut state2).unwrap());
but this swaps two pinned CondVar
, which is unsound. After pinning the CondVar
, we shouldn't be able to obtain any Arc<SharedState>
, but rather only Pin<Arc<SharedState>>
.
obviyus
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersunsoundThe possibility of UB in safe code.The possibility of UB in safe code.• driversRelated to the example drivers in `drivers/`.Related to the example drivers in `drivers/`.