driver-manager: fix E0382 — clone Arc for the second listener closure
spawn_unified_listener takes two move closures that both capture scheme_for_events
(bound_device_pairs provider + the Aer event handler calling dispatch_recovery).
The first closure moved the Arc, so the second could not use it ("the type Arc
does not implement Copy", main.rs:390). Clone the Arc for the bound-pairs closure
so each owns its own handle (the rustc-suggested fix). Sole remaining compile
blocker for the redbear-full ISO.
This commit is contained in:
@@ -383,10 +383,14 @@ fn main() {
|
||||
));
|
||||
|
||||
let scheme_for_events = Arc::clone(&scheme);
|
||||
// Both listener callbacks capture the scheme Arc by move: the bound-pairs
|
||||
// provider closure and the event handler (which calls dispatch_recovery).
|
||||
// Clone one so each closure owns its own Arc (Arc is not Copy).
|
||||
let scheme_for_pairs = Arc::clone(&scheme_for_events);
|
||||
let _events_thread = unified_events::spawn_unified_listener(
|
||||
std::path::PathBuf::from("/scheme/pci/aer"),
|
||||
std::path::PathBuf::from("/scheme/pci/pciehp"),
|
||||
move || scheme_for_events.bound_device_pairs(),
|
||||
move || scheme_for_pairs.bound_device_pairs(),
|
||||
move |event| match event {
|
||||
unified_events::UnifiedEvent::Aer { event, action } => {
|
||||
if matches!(
|
||||
|
||||
Reference in New Issue
Block a user