X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Fbacktrace.rs;h=9cb74f951dd3721df31b3e74086bbe7a3f3e9e91;hb=2d2c9e44939d44e03bd6b9922b584ff09fb513e6;hp=34b57c37635cb44384ff7145b588150e1344a1d8;hpb=fa0ca783f89a83046e6ce0383385ba5b28296435;p=rust.git diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs index 34b57c37635..9cb74f951dd 100644 --- a/library/std/src/backtrace.rs +++ b/library/std/src/backtrace.rs @@ -325,8 +325,7 @@ pub const fn disabled() -> Backtrace { // Capture a backtrace which start just before the function addressed by // `ip` fn create(ip: usize) -> Backtrace { - // SAFETY: We don't attempt to lock this reentrantly. - let _lock = unsafe { lock() }; + let _lock = lock(); let mut frames = Vec::new(); let mut actual_start = None; unsafe { @@ -469,8 +468,7 @@ fn resolve(&mut self) { // Use the global backtrace lock to synchronize this as it's a // requirement of the `backtrace` crate, and then actually resolve // everything. - // SAFETY: We don't attempt to lock this reentrantly. - let _lock = unsafe { lock() }; + let _lock = lock(); for frame in self.frames.iter_mut() { let symbols = &mut frame.symbols; let frame = match &frame.frame {