Skip to content

Commit ccb36a6

Browse files
committed
std::thread: add SAFETY comment
1 parent 95f6a01 commit ccb36a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/thread/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ impl Builder {
546546
}
547547

548548
let main = Box::new(main);
549+
// SAFETY: dynamic size and alignment of the Box remain the same. See below for why the
550+
// lifetime change is justified.
549551
#[cfg(bootstrap)]
550552
let main =
551553
unsafe { mem::transmute::<Box<dyn FnOnce() + 'a>, Box<dyn FnOnce() + 'static>>(main) };

0 commit comments

Comments
 (0)