diff --git a/Cargo.lock b/Cargo.lock index ec4f3091d2da2..c1b6dfbabd28f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3556,6 +3556,7 @@ dependencies = [ "tracing", "tracing-subscriber", "tracing-tree", + "unwind", "winapi 0.3.9", ] @@ -5279,8 +5280,8 @@ dependencies = [ "cc", "cfg-if", "compiler_builtins", - "core", "libc", + "rustc-std-workspace-core", ] [[package]] diff --git a/compiler/rustc_driver/Cargo.toml b/compiler/rustc_driver/Cargo.toml index 0adc006b6244e..00b340d9b894e 100644 --- a/compiler/rustc_driver/Cargo.toml +++ b/compiler/rustc_driver/Cargo.toml @@ -34,6 +34,9 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_ast = { path = "../rustc_ast" } rustc_span = { path = "../rustc_span" } +# Make sure we link to an unwinder +unwind = { path = "../../library/unwind" } + [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"] } diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index 575c2e627ed73..e5e96fcb0d7ea 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -7,11 +7,16 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(nll)] #![feature(once_cell)] +#![feature(panic_unwind)] #![recursion_limit = "256"] #[macro_use] extern crate tracing; +// This is here just to make sure we link to an unwinder +#[allow(unused_extern_crates)] +extern crate unwind; + pub extern crate rustc_plugin_impl as plugin; use rustc_ast as ast; diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index c08828bc0cde9..f894966d29a7b 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -19,7 +19,7 @@ core = { path = "../core" } libc = { version = "0.2.79", default-features = false, features = ['rustc-dep-of-std'] } compiler_builtins = { version = "0.1.35" } profiler_builtins = { path = "../profiler_builtins", optional = true } -unwind = { path = "../unwind" } +unwind = { path = "../unwind", features = ['rustc-dep-of-std'] } hashbrown = { version = "0.9.0", default-features = false, features = ['rustc-dep-of-std'] } # Dependencies of the `backtrace` crate diff --git a/library/unwind/Cargo.toml b/library/unwind/Cargo.toml index 7138d0c8fea6d..e226d892e08c7 100644 --- a/library/unwind/Cargo.toml +++ b/library/unwind/Cargo.toml @@ -13,9 +13,9 @@ bench = false doc = false [dependencies] -core = { path = "../core" } -libc = { version = "0.2.79", features = ['rustc-dep-of-std'], default-features = false } -compiler_builtins = "0.1.0" +core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' } +libc = { version = "0.2.79", default-features = false } +compiler_builtins = { version = "0.1.0", optional = true } cfg-if = "0.1.8" [build-dependencies] @@ -23,3 +23,4 @@ cc = { version = "1.0.1" } [features] llvm-libunwind = [] +rustc-dep-of-std = ['compiler_builtins', 'core', 'libc/rustc-dep-of-std']