Skip to content

Commit 3ecd19f

Browse files
committed
fix
1 parent 51136bd commit 3ecd19f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_driver/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,11 +1214,12 @@ pub fn in_rustc_thread<F, R>(f: F) -> Result<R, Box<Any + Send>>
12141214
/// errors of the compiler.
12151215
pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
12161216
let data = Arc::new(Mutex::new(Vec::new()));
1217+
let data_for_thread = data.clone();
12171218
let err = Sink(data.clone());
12181219

12191220
let result = in_rustc_thread(move || {
12201221
io::set_panic(Some(box err));
1221-
PANIC_SINK.set(data.clone(), || {
1222+
PANIC_SINK.set(&data_for_thread, || {
12221223
f()
12231224
})
12241225
});

0 commit comments

Comments
 (0)