Rollup merge of #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 https://github.com/rust-lang/rust/issues/109486.
This commit is contained in:
Matthias Krüger 2023-05-06 13:30:04 +02:00 committed by GitHub
commit 48e380fa40

View File

@ -1,3 +1,5 @@
#![feature(rustc_private)]
use anyhow::{format_err, Result};
use io::Error as IoError;
@ -19,7 +21,14 @@
FormatReportFormatterBuilder, Input, Session, Verbosity,
};
const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rustfmt/issues/new?labels=bug";
// N.B. these crates are loaded from the sysroot, so they need extern crate.
extern crate rustc_driver;
fn main() {
rustc_driver::install_ice_hook(BUG_REPORT_URL, |_| ());
env_logger::Builder::from_env("RUSTFMT_LOG").init();
let opts = make_opts();