Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 89b5784

Browse files
committedJun 16, 2024
std: move sys_common::backtrace to sys
1 parent 6832ad3 commit 89b5784

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed
 

‎std/src/backtrace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ use crate::fmt;
9595
use crate::panic::UnwindSafe;
9696
use crate::sync::atomic::{AtomicU8, Ordering::Relaxed};
9797
use crate::sync::LazyLock;
98-
use crate::sys_common::backtrace::{lock, output_filename, set_image_base};
98+
use crate::sys::backtrace::{lock, output_filename, set_image_base};
9999

100100
/// A captured OS thread stack backtrace.
101101
///

‎std/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl<E> Report<E> {
429429
/// 1: rust_out::main::_doctest_main_src_error_rs_1158_0
430430
/// 2: rust_out::main
431431
/// 3: core::ops::function::FnOnce::call_once
432-
/// 4: std::sys_common::backtrace::__rust_begin_short_backtrace
432+
/// 4: std::sys::backtrace::__rust_begin_short_backtrace
433433
/// 5: std::rt::lang_start::{{closure}}
434434
/// 6: std::panicking::try
435435
/// 7: std::rt::lang_start_internal

‎std/src/panicking.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::mem::{self, ManuallyDrop};
1919
use crate::process;
2020
use crate::sync::atomic::{AtomicBool, Ordering};
2121
use crate::sync::{PoisonError, RwLock};
22+
use crate::sys::backtrace;
2223
use crate::sys::stdio::panic_output;
23-
use crate::sys_common::backtrace;
2424
use crate::thread;
2525

2626
#[cfg(not(test))]
@@ -655,7 +655,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
655655

656656
let loc = info.location().unwrap(); // The current implementation always returns Some
657657
let msg = info.message();
658-
crate::sys_common::backtrace::__rust_end_short_backtrace(move || {
658+
crate::sys::backtrace::__rust_end_short_backtrace(move || {
659659
if let Some(s) = msg.as_str() {
660660
rust_panic_with_hook(
661661
&mut StaticStrPayload(s),
@@ -727,7 +727,7 @@ pub const fn begin_panic<M: Any + Send>(msg: M) -> ! {
727727
}
728728

729729
let loc = Location::caller();
730-
crate::sys_common::backtrace::__rust_end_short_backtrace(move || {
730+
crate::sys::backtrace::__rust_end_short_backtrace(move || {
731731
rust_panic_with_hook(
732732
&mut Payload { inner: Some(msg) },
733733
loc,

‎std/src/rt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn lang_start<T: crate::process::Termination + 'static>(
156156
sigpipe: u8,
157157
) -> isize {
158158
let Ok(v) = lang_start_internal(
159-
&move || crate::sys_common::backtrace::__rust_begin_short_backtrace(main).report().to_i32(),
159+
&move || crate::sys::backtrace::__rust_begin_short_backtrace(main).report().to_i32(),
160160
argc,
161161
argv,
162162
sigpipe,

‎std/src/sys_common/backtrace.rs ‎std/src/sys/backtrace.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
//! Common code for printing backtraces.
2+
13
use crate::backtrace_rs::{self, BacktraceFmt, BytesOrWideString, PrintFmt};
24
use crate::borrow::Cow;
3-
/// Common code for printing the backtrace in the same way across the different
4-
/// supported platforms.
55
use crate::env;
66
use crate::fmt;
77
use crate::io;

‎std/src/sys/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mod pal;
55

66
mod personality;
77

8+
pub mod backtrace;
89
pub mod cmath;
910
pub mod os_str;
1011
pub mod path;

‎std/src/sys_common/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#[cfg(test)]
2121
mod tests;
2222

23-
pub mod backtrace;
2423
pub mod fs;
2524
pub mod io;
2625
pub mod lazy_box;

‎std/src/thread/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl Builder {
539539
let f = f.into_inner();
540540
set_current(their_thread);
541541
let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
542-
crate::sys_common::backtrace::__rust_begin_short_backtrace(f)
542+
crate::sys::backtrace::__rust_begin_short_backtrace(f)
543543
}));
544544
// SAFETY: `their_packet` as been built just above and moved by the
545545
// closure (it is an Arc<...>) and `my_packet` will be stored in the

0 commit comments

Comments
 (0)
Failed to load comments.