Skip to content

Commit 48e380f

Browse files
authored
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
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. I haven't changed clippy in case they want to make the change upstream instead of the subtree, but I'm happy to do so here if the maintainers want - cc ````@rust-lang/clippy```` Fixes rust-lang#109486.
2 parents 8ed5d5d + 34a71f6 commit 48e380f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bin/main.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![feature(rustc_private)]
2+
13
use anyhow::{format_err, Result};
24

35
use io::Error as IoError;
@@ -19,7 +21,14 @@ use crate::rustfmt::{
1921
FormatReportFormatterBuilder, Input, Session, Verbosity,
2022
};
2123

24+
const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rustfmt/issues/new?labels=bug";
25+
26+
// N.B. these crates are loaded from the sysroot, so they need extern crate.
27+
extern crate rustc_driver;
28+
2229
fn main() {
30+
rustc_driver::install_ice_hook(BUG_REPORT_URL, |_| ());
31+
2332
env_logger::Builder::from_env("RUSTFMT_LOG").init();
2433
let opts = make_opts();
2534

0 commit comments

Comments
 (0)