Revert "std: Switch from libbacktrace to gimli"
This reverts commit 13db3cc1e8
.
This commit is contained in:
parent
3c6003c4c0
commit
cc4f547cf4
13 changed files with 55 additions and 108 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -44,6 +44,3 @@
|
||||||
[submodule "src/tools/rust-analyzer"]
|
[submodule "src/tools/rust-analyzer"]
|
||||||
path = src/tools/rust-analyzer
|
path = src/tools/rust-analyzer
|
||||||
url = https://github.com/rust-analyzer/rust-analyzer.git
|
url = https://github.com/rust-analyzer/rust-analyzer.git
|
||||||
[submodule "src/backtrace"]
|
|
||||||
path = src/backtrace
|
|
||||||
url = https://github.com/rust-lang/backtrace-rs.git
|
|
||||||
|
|
88
Cargo.lock
88
Cargo.lock
|
@ -1,26 +1,10 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "adler32"
|
||||||
version = "0.13.0"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
|
checksum = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
|
||||||
dependencies = [
|
|
||||||
"compiler_builtins",
|
|
||||||
"gimli",
|
|
||||||
"rustc-std-workspace-alloc",
|
|
||||||
"rustc-std-workspace-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "adler"
|
|
||||||
version = "0.2.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ccc9a9dd069569f212bc4330af9f17c4afb5e8ce185e83dbb14f1349dda18b10"
|
|
||||||
dependencies = [
|
|
||||||
"compiler_builtins",
|
|
||||||
"rustc-std-workspace-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
|
@ -141,14 +125,28 @@ checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "backtrace"
|
name = "backtrace"
|
||||||
version = "0.3.50"
|
version = "0.3.46"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"addr2line",
|
"backtrace-sys",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
"compiler_builtins",
|
||||||
"libc",
|
"libc",
|
||||||
"miniz_oxide",
|
|
||||||
"object",
|
|
||||||
"rustc-demangle",
|
"rustc-demangle",
|
||||||
|
"rustc-std-workspace-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "backtrace-sys"
|
||||||
|
version = "0.1.37"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "18fbebbe1c9d1f383a9cc7e8ccdb471b91c8d024ee9c2ca5b5346121fe8b4399"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"compiler_builtins",
|
||||||
|
"libc",
|
||||||
|
"rustc-std-workspace-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -690,9 +688,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc32fast"
|
name = "crc32fast"
|
||||||
version = "1.2.0"
|
version = "1.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
|
checksum = "e91d5240c6975ef33aeb5f148f35275c25eda8e8a5f95abe421978b05b8bf192"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
@ -1025,9 +1023,9 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.16"
|
version = "1.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e"
|
checksum = "ad3c5233c9a940c8719031b423d7e6c16af66e031cb0420b0896f5245bf181d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
|
@ -1161,17 +1159,6 @@ dependencies = [
|
||||||
"wasi",
|
"wasi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gimli"
|
|
||||||
version = "0.22.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
|
|
||||||
dependencies = [
|
|
||||||
"compiler_builtins",
|
|
||||||
"rustc-std-workspace-alloc",
|
|
||||||
"rustc-std-workspace-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git2"
|
name = "git2"
|
||||||
version = "0.13.5"
|
version = "0.13.5"
|
||||||
|
@ -1832,14 +1819,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.4.0"
|
version = "0.3.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f"
|
checksum = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"adler",
|
"adler32",
|
||||||
"compiler_builtins",
|
|
||||||
"rustc-std-workspace-alloc",
|
|
||||||
"rustc-std-workspace-core",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1971,17 +1955,6 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "object"
|
|
||||||
version = "0.20.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
|
|
||||||
dependencies = [
|
|
||||||
"compiler_builtins",
|
|
||||||
"rustc-std-workspace-alloc",
|
|
||||||
"rustc-std-workspace-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -4373,8 +4346,8 @@ dependencies = [
|
||||||
name = "std"
|
name = "std"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"addr2line",
|
|
||||||
"alloc",
|
"alloc",
|
||||||
|
"backtrace",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"compiler_builtins",
|
"compiler_builtins",
|
||||||
"core",
|
"core",
|
||||||
|
@ -4383,13 +4356,10 @@ dependencies = [
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"libc",
|
"libc",
|
||||||
"miniz_oxide",
|
|
||||||
"object",
|
|
||||||
"panic_abort",
|
"panic_abort",
|
||||||
"panic_unwind",
|
"panic_unwind",
|
||||||
"profiler_builtins",
|
"profiler_builtins",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rustc-demangle",
|
|
||||||
"unwind",
|
"unwind",
|
||||||
"wasi",
|
"wasi",
|
||||||
]
|
]
|
||||||
|
|
|
@ -80,11 +80,5 @@ rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' }
|
||||||
rustc-std-workspace-alloc = { path = 'src/tools/rustc-std-workspace-alloc' }
|
rustc-std-workspace-alloc = { path = 'src/tools/rustc-std-workspace-alloc' }
|
||||||
rustc-std-workspace-std = { path = 'src/tools/rustc-std-workspace-std' }
|
rustc-std-workspace-std = { path = 'src/tools/rustc-std-workspace-std' }
|
||||||
|
|
||||||
# This crate's integration with libstd is a bit wonky, so we use a submodule
|
|
||||||
# instead of a crates.io dependency. Make sure everything else in the repo is
|
|
||||||
# also using the submodule, however, so we can avoid duplicate copies of the
|
|
||||||
# source code for this crate.
|
|
||||||
backtrace = { path = "src/backtrace" }
|
|
||||||
|
|
||||||
[patch."https://github.com/rust-lang/rust-clippy"]
|
[patch."https://github.com/rust-lang/rust-clippy"]
|
||||||
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
|
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
|
||||||
|
|
|
@ -30,7 +30,6 @@ ignore = [
|
||||||
"src/tools/rust-analyzer",
|
"src/tools/rust-analyzer",
|
||||||
"src/tools/rust-installer",
|
"src/tools/rust-installer",
|
||||||
"src/tools/rustfmt",
|
"src/tools/rustfmt",
|
||||||
"src/backtrace",
|
|
||||||
|
|
||||||
# We do not format this file as it is externally sourced and auto-generated.
|
# We do not format this file as it is externally sourced and auto-generated.
|
||||||
"src/libstd/sys/cloudabi/abi/cloudabi.rs",
|
"src/libstd/sys/cloudabi/abi/cloudabi.rs",
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 8f89434446f72f27f8145d8bbc1a302c6ef29d1e
|
|
|
@ -25,15 +25,11 @@ profiler_builtins = { path = "../libprofiler_builtins", optional = true }
|
||||||
unwind = { path = "../libunwind" }
|
unwind = { path = "../libunwind" }
|
||||||
hashbrown = { version = "0.6.2", default-features = false, features = ['rustc-dep-of-std'] }
|
hashbrown = { version = "0.6.2", default-features = false, features = ['rustc-dep-of-std'] }
|
||||||
|
|
||||||
# Dependencies of the `backtrace` crate
|
[dependencies.backtrace_rs]
|
||||||
addr2line = { version = "0.13.0", optional = true, default-features = false }
|
package = "backtrace"
|
||||||
rustc-demangle = { version = "0.1.4", optional = true }
|
version = "0.3.46"
|
||||||
miniz_oxide = { version = "0.4.0", optional = true, default-features = false }
|
default-features = false # without the libstd `backtrace` feature, stub out everything
|
||||||
[dependencies.object]
|
features = [ "rustc-dep-of-std" ] # enable build support for integrating into libstd
|
||||||
version = "0.20"
|
|
||||||
optional = true
|
|
||||||
default-features = false
|
|
||||||
features = ['read_core', 'elf', 'macho', 'pe']
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
@ -52,13 +48,11 @@ wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features =
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
backtrace = [
|
backtrace = [
|
||||||
"gimli-symbolize",
|
"backtrace_rs/dbghelp", # backtrace/symbolize on MSVC
|
||||||
'addr2line/rustc-dep-of-std',
|
"backtrace_rs/libbacktrace", # symbolize on most platforms
|
||||||
'object/rustc-dep-of-std',
|
"backtrace_rs/libunwind", # backtrace on most platforms
|
||||||
'rustc-demangle/rustc-dep-of-std',
|
"backtrace_rs/dladdr", # symbolize on platforms w/o libbacktrace
|
||||||
'miniz_oxide/rustc-dep-of-std',
|
|
||||||
]
|
]
|
||||||
gimli-symbolize = []
|
|
||||||
|
|
||||||
panic-unwind = ["panic_unwind"]
|
panic-unwind = ["panic_unwind"]
|
||||||
profiler = ["profiler_builtins"]
|
profiler = ["profiler_builtins"]
|
||||||
|
|
|
@ -91,7 +91,6 @@
|
||||||
// `Backtrace`, but that's a relatively small price to pay relative to capturing
|
// `Backtrace`, but that's a relatively small price to pay relative to capturing
|
||||||
// a backtrace or actually symbolizing it.
|
// a backtrace or actually symbolizing it.
|
||||||
|
|
||||||
use crate::backtrace_rs::{self, BytesOrWideString};
|
|
||||||
use crate::env;
|
use crate::env;
|
||||||
use crate::ffi::c_void;
|
use crate::ffi::c_void;
|
||||||
use crate::fmt;
|
use crate::fmt;
|
||||||
|
@ -99,6 +98,8 @@ use crate::sync::atomic::{AtomicUsize, Ordering::SeqCst};
|
||||||
use crate::sync::Mutex;
|
use crate::sync::Mutex;
|
||||||
use crate::sys_common::backtrace::{lock, output_filename};
|
use crate::sys_common::backtrace::{lock, output_filename};
|
||||||
use crate::vec::Vec;
|
use crate::vec::Vec;
|
||||||
|
use backtrace::BytesOrWideString;
|
||||||
|
use backtrace_rs as backtrace;
|
||||||
|
|
||||||
/// A captured OS thread stack backtrace.
|
/// A captured OS thread stack backtrace.
|
||||||
///
|
///
|
||||||
|
@ -149,7 +150,7 @@ struct BacktraceFrame {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RawFrame {
|
enum RawFrame {
|
||||||
Actual(backtrace_rs::Frame),
|
Actual(backtrace::Frame),
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
Fake,
|
Fake,
|
||||||
}
|
}
|
||||||
|
@ -196,7 +197,7 @@ impl fmt::Debug for BacktraceSymbol {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(fmt, "{{ ")?;
|
write!(fmt, "{{ ")?;
|
||||||
|
|
||||||
if let Some(fn_name) = self.name.as_ref().map(|b| backtrace_rs::SymbolName::new(b)) {
|
if let Some(fn_name) = self.name.as_ref().map(|b| backtrace::SymbolName::new(b)) {
|
||||||
write!(fmt, "fn: \"{:#}\"", fn_name)?;
|
write!(fmt, "fn: \"{:#}\"", fn_name)?;
|
||||||
} else {
|
} else {
|
||||||
write!(fmt, "fn: <unknown>")?;
|
write!(fmt, "fn: <unknown>")?;
|
||||||
|
@ -222,7 +223,7 @@ impl fmt::Debug for BytesOrWide {
|
||||||
BytesOrWide::Bytes(w) => BytesOrWideString::Bytes(w),
|
BytesOrWide::Bytes(w) => BytesOrWideString::Bytes(w),
|
||||||
BytesOrWide::Wide(w) => BytesOrWideString::Wide(w),
|
BytesOrWide::Wide(w) => BytesOrWideString::Wide(w),
|
||||||
},
|
},
|
||||||
backtrace_rs::PrintFmt::Short,
|
backtrace::PrintFmt::Short,
|
||||||
crate::env::current_dir().as_ref().ok(),
|
crate::env::current_dir().as_ref().ok(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -298,7 +299,7 @@ impl Backtrace {
|
||||||
let mut frames = Vec::new();
|
let mut frames = Vec::new();
|
||||||
let mut actual_start = None;
|
let mut actual_start = None;
|
||||||
unsafe {
|
unsafe {
|
||||||
backtrace_rs::trace_unsynchronized(|frame| {
|
backtrace::trace_unsynchronized(|frame| {
|
||||||
frames.push(BacktraceFrame {
|
frames.push(BacktraceFrame {
|
||||||
frame: RawFrame::Actual(frame.clone()),
|
frame: RawFrame::Actual(frame.clone()),
|
||||||
symbols: Vec::new(),
|
symbols: Vec::new(),
|
||||||
|
@ -349,9 +350,9 @@ impl fmt::Display for Backtrace {
|
||||||
|
|
||||||
let full = fmt.alternate();
|
let full = fmt.alternate();
|
||||||
let (frames, style) = if full {
|
let (frames, style) = if full {
|
||||||
(&capture.frames[..], backtrace_rs::PrintFmt::Full)
|
(&capture.frames[..], backtrace::PrintFmt::Full)
|
||||||
} else {
|
} else {
|
||||||
(&capture.frames[capture.actual_start..], backtrace_rs::PrintFmt::Short)
|
(&capture.frames[capture.actual_start..], backtrace::PrintFmt::Short)
|
||||||
};
|
};
|
||||||
|
|
||||||
// When printing paths we try to strip the cwd if it exists, otherwise
|
// When printing paths we try to strip the cwd if it exists, otherwise
|
||||||
|
@ -363,7 +364,7 @@ impl fmt::Display for Backtrace {
|
||||||
output_filename(fmt, path, style, cwd.as_ref().ok())
|
output_filename(fmt, path, style, cwd.as_ref().ok())
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut f = backtrace_rs::BacktraceFmt::new(fmt, style, &mut print_path);
|
let mut f = backtrace::BacktraceFmt::new(fmt, style, &mut print_path);
|
||||||
f.add_context()?;
|
f.add_context()?;
|
||||||
for frame in frames {
|
for frame in frames {
|
||||||
let mut f = f.frame();
|
let mut f = f.frame();
|
||||||
|
@ -373,7 +374,7 @@ impl fmt::Display for Backtrace {
|
||||||
for symbol in frame.symbols.iter() {
|
for symbol in frame.symbols.iter() {
|
||||||
f.print_raw(
|
f.print_raw(
|
||||||
frame.frame.ip(),
|
frame.frame.ip(),
|
||||||
symbol.name.as_ref().map(|b| backtrace_rs::SymbolName::new(b)),
|
symbol.name.as_ref().map(|b| backtrace::SymbolName::new(b)),
|
||||||
symbol.filename.as_ref().map(|b| match b {
|
symbol.filename.as_ref().map(|b| match b {
|
||||||
BytesOrWide::Bytes(w) => BytesOrWideString::Bytes(w),
|
BytesOrWide::Bytes(w) => BytesOrWideString::Bytes(w),
|
||||||
BytesOrWide::Wide(w) => BytesOrWideString::Wide(w),
|
BytesOrWide::Wide(w) => BytesOrWideString::Wide(w),
|
||||||
|
@ -408,7 +409,7 @@ impl Capture {
|
||||||
RawFrame::Fake => unimplemented!(),
|
RawFrame::Fake => unimplemented!(),
|
||||||
};
|
};
|
||||||
unsafe {
|
unsafe {
|
||||||
backtrace_rs::resolve_frame_unsynchronized(frame, |symbol| {
|
backtrace::resolve_frame_unsynchronized(frame, |symbol| {
|
||||||
symbols.push(BacktraceSymbol {
|
symbols.push(BacktraceSymbol {
|
||||||
name: symbol.name().map(|m| m.as_bytes().to_vec()),
|
name: symbol.name().map(|m| m.as_bytes().to_vec()),
|
||||||
filename: symbol.filename_raw().map(|b| match b {
|
filename: symbol.filename_raw().map(|b| match b {
|
||||||
|
|
|
@ -87,5 +87,4 @@ fn main() {
|
||||||
println!("cargo:rustc-cfg=feature=\"restricted-std\"");
|
println!("cargo:rustc-cfg=feature=\"restricted-std\"");
|
||||||
}
|
}
|
||||||
println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap());
|
println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap());
|
||||||
println!("cargo:rustc-cfg=backtrace_in_libstd");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -511,10 +511,6 @@ mod panicking;
|
||||||
// compiler
|
// compiler
|
||||||
pub mod rt;
|
pub mod rt;
|
||||||
|
|
||||||
#[path = "../backtrace/src/lib.rs"]
|
|
||||||
#[allow(dead_code, unused_attributes)]
|
|
||||||
mod backtrace_rs;
|
|
||||||
|
|
||||||
// Pull in the `std_detect` crate directly into libstd. The contents of
|
// Pull in the `std_detect` crate directly into libstd. The contents of
|
||||||
// `std_detect` are in a different repository: rust-lang/stdarch.
|
// `std_detect` are in a different repository: rust-lang/stdarch.
|
||||||
//
|
//
|
||||||
|
|
|
@ -171,7 +171,7 @@ fn default_hook(info: &PanicInfo<'_>) {
|
||||||
// If this is a double panic, make sure that we print a backtrace
|
// If this is a double panic, make sure that we print a backtrace
|
||||||
// for this panic. Otherwise only print it if logging is enabled.
|
// for this panic. Otherwise only print it if logging is enabled.
|
||||||
let backtrace_env = if panic_count::get() >= 2 {
|
let backtrace_env = if panic_count::get() >= 2 {
|
||||||
RustBacktrace::Print(crate::backtrace_rs::PrintFmt::Full)
|
RustBacktrace::Print(backtrace_rs::PrintFmt::Full)
|
||||||
} else {
|
} else {
|
||||||
backtrace::rust_backtrace_env()
|
backtrace::rust_backtrace_env()
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use crate::backtrace_rs::{self, BacktraceFmt, BytesOrWideString, PrintFmt};
|
|
||||||
use crate::borrow::Cow;
|
use crate::borrow::Cow;
|
||||||
/// Common code for printing the backtrace in the same way across the different
|
/// Common code for printing the backtrace in the same way across the different
|
||||||
/// supported platforms.
|
/// supported platforms.
|
||||||
|
@ -10,6 +9,8 @@ use crate::path::{self, Path, PathBuf};
|
||||||
use crate::sync::atomic::{self, Ordering};
|
use crate::sync::atomic::{self, Ordering};
|
||||||
use crate::sys::mutex::Mutex;
|
use crate::sys::mutex::Mutex;
|
||||||
|
|
||||||
|
use backtrace_rs::{BacktraceFmt, BytesOrWideString, PrintFmt};
|
||||||
|
|
||||||
/// Max number of frames to print.
|
/// Max number of frames to print.
|
||||||
const MAX_NB_FRAMES: usize = 100;
|
const MAX_NB_FRAMES: usize = 100;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ const LICENSES: &[&str] = &[
|
||||||
"MIT",
|
"MIT",
|
||||||
"Unlicense/MIT",
|
"Unlicense/MIT",
|
||||||
"Unlicense OR MIT",
|
"Unlicense OR MIT",
|
||||||
"0BSD OR MIT OR Apache-2.0", // adler license
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/// These are exceptions to Rust's permissive licensing policy, and
|
/// These are exceptions to Rust's permissive licensing policy, and
|
||||||
|
@ -37,6 +36,7 @@ const EXCEPTIONS: &[(&str, &str)] = &[
|
||||||
("ryu", "Apache-2.0 OR BSL-1.0"), // rls/cargo/... (because of serde)
|
("ryu", "Apache-2.0 OR BSL-1.0"), // rls/cargo/... (because of serde)
|
||||||
("bytesize", "Apache-2.0"), // cargo
|
("bytesize", "Apache-2.0"), // cargo
|
||||||
("im-rc", "MPL-2.0+"), // cargo
|
("im-rc", "MPL-2.0+"), // cargo
|
||||||
|
("adler32", "BSD-3-Clause AND Zlib"), // cargo dep that isn't used
|
||||||
("constant_time_eq", "CC0-1.0"), // rustfmt
|
("constant_time_eq", "CC0-1.0"), // rustfmt
|
||||||
("sized-chunks", "MPL-2.0+"), // cargo via im-rc
|
("sized-chunks", "MPL-2.0+"), // cargo via im-rc
|
||||||
("bitmaps", "MPL-2.0+"), // cargo via im-rc
|
("bitmaps", "MPL-2.0+"), // cargo via im-rc
|
||||||
|
@ -57,8 +57,7 @@ const RESTRICTED_DEPENDENCY_CRATES: &[&str] = &["rustc_middle", "rustc_codegen_l
|
||||||
/// This list is here to provide a speed-bump to adding a new dependency to
|
/// This list is here to provide a speed-bump to adding a new dependency to
|
||||||
/// rustc. Please check with the compiler team before adding an entry.
|
/// rustc. Please check with the compiler team before adding an entry.
|
||||||
const PERMITTED_DEPENDENCIES: &[&str] = &[
|
const PERMITTED_DEPENDENCIES: &[&str] = &[
|
||||||
"addr2line",
|
"adler32",
|
||||||
"adler",
|
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"annotate-snippets",
|
"annotate-snippets",
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
|
@ -66,6 +65,7 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
|
||||||
"atty",
|
"atty",
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"backtrace",
|
"backtrace",
|
||||||
|
"backtrace-sys",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"block-buffer",
|
"block-buffer",
|
||||||
"block-padding",
|
"block-padding",
|
||||||
|
@ -98,7 +98,6 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
|
||||||
"generic-array",
|
"generic-array",
|
||||||
"getopts",
|
"getopts",
|
||||||
"getrandom",
|
"getrandom",
|
||||||
"gimli",
|
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"humantime",
|
"humantime",
|
||||||
|
@ -120,7 +119,6 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
"nodrop",
|
"nodrop",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"object",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"opaque-debug",
|
"opaque-debug",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
|
|
|
@ -60,7 +60,6 @@ fn filter_dirs(path: &Path) -> bool {
|
||||||
"src/tools/rust-installer",
|
"src/tools/rust-installer",
|
||||||
"src/tools/rustfmt",
|
"src/tools/rustfmt",
|
||||||
"src/doc/book",
|
"src/doc/book",
|
||||||
"src/backtrace",
|
|
||||||
// Filter RLS output directories
|
// Filter RLS output directories
|
||||||
"target/rls",
|
"target/rls",
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Reference in a new issue