Skip to content

Commit 2a5fe25

Browse files
committed
Make the BUG_REPORT_URL configurable by tools
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt
1 parent 3027998 commit 2a5fe25

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bin/miri.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,10 @@ fn main() {
286286
// (`install_ice_hook` might change `RUST_BACKTRACE`.)
287287
let env_snapshot = env::vars_os().collect::<Vec<_>>();
288288

289-
// Earliest rustc setup.
290-
rustc_driver::install_ice_hook();
291-
292289
// If the environment asks us to actually be rustc, then do that.
293290
if let Some(crate_kind) = env::var_os("MIRI_BE_RUSTC") {
291+
// Earliest rustc setup.
292+
rustc_driver::install_ice_hook(rustc_driver::DEFAULT_BUG_REPORT_URL, |_| ());
294293
rustc_driver::init_rustc_env_logger();
295294

296295
let target_crate = if crate_kind == "target" {
@@ -309,6 +308,9 @@ fn main() {
309308
)
310309
}
311310

311+
// Add an ICE bug report hook.
312+
rustc_driver::install_ice_hook("https://github.com/rust-lang/miri/issues/new", |_| ());
313+
312314
// Init loggers the Miri way.
313315
init_early_loggers();
314316

0 commit comments

Comments
 (0)