Skip to content

Commit f9d62a8

Browse files
authored
Rollup merge of #117281 - RalfJung:thread-safety, r=thomcc
std::thread : add SAFETY comment I forgot to add this in #117266.
2 parents 60b071f + ccb36a6 commit f9d62a8

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)