Skip to content

Commit 8645659

Browse files
committed
make sure rustc_driver links to an unwinder
Fixes #76020 Signed-off-by: Marc-Antoine Perennou <[email protected]>
1 parent c6bebc1 commit 8645659

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

Cargo.lock

+2-1
Original file line numberDiff line numberDiff line change
@@ -3556,6 +3556,7 @@ dependencies = [
35563556
"tracing",
35573557
"tracing-subscriber",
35583558
"tracing-tree",
3559+
"unwind",
35593560
"winapi 0.3.9",
35603561
]
35613562

@@ -5279,8 +5280,8 @@ dependencies = [
52795280
"cc",
52805281
"cfg-if",
52815282
"compiler_builtins",
5282-
"core",
52835283
"libc",
5284+
"rustc-std-workspace-core",
52845285
]
52855286

52865287
[[package]]

compiler/rustc_driver/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ rustc_serialize = { path = "../rustc_serialize" }
3434
rustc_ast = { path = "../rustc_ast" }
3535
rustc_span = { path = "../rustc_span" }
3636

37+
# Make sure we link to an unwinder
38+
unwind = { path = "../../library/unwind" }
39+
3740
[target.'cfg(windows)'.dependencies]
3841
winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"] }
3942

compiler/rustc_driver/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
88
#![feature(nll)]
99
#![feature(once_cell)]
10+
#![feature(panic_unwind)]
1011
#![recursion_limit = "256"]
1112

1213
#[macro_use]
1314
extern crate tracing;
1415

16+
// This is here just to make sure we link to an unwinder
17+
#[allow(unused_extern_crates)]
18+
extern crate unwind;
19+
1520
pub extern crate rustc_plugin_impl as plugin;
1621

1722
use rustc_ast as ast;

library/std/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ core = { path = "../core" }
1919
libc = { version = "0.2.79", default-features = false, features = ['rustc-dep-of-std'] }
2020
compiler_builtins = { version = "0.1.35" }
2121
profiler_builtins = { path = "../profiler_builtins", optional = true }
22-
unwind = { path = "../unwind" }
22+
unwind = { path = "../unwind", features = ['rustc-dep-of-std'] }
2323
hashbrown = { version = "0.9.0", default-features = false, features = ['rustc-dep-of-std'] }
2424

2525
# Dependencies of the `backtrace` crate

library/unwind/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ bench = false
1313
doc = false
1414

1515
[dependencies]
16-
core = { path = "../core" }
17-
libc = { version = "0.2.79", features = ['rustc-dep-of-std'], default-features = false }
18-
compiler_builtins = "0.1.0"
16+
core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' }
17+
libc = { version = "0.2.79", default-features = false }
18+
compiler_builtins = { version = "0.1.0", optional = true }
1919
cfg-if = "0.1.8"
2020

2121
[build-dependencies]
2222
cc = { version = "1.0.1" }
2323

2424
[features]
2525
llvm-libunwind = []
26+
rustc-dep-of-std = ['compiler_builtins', 'core', 'libc/rustc-dep-of-std']

0 commit comments

Comments
 (0)