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:
commit
48e380fa40
@ -1,3 +1,5 @@
|
|||||||
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
use anyhow::{format_err, Result};
|
use anyhow::{format_err, Result};
|
||||||
|
|
||||||
use io::Error as IoError;
|
use io::Error as IoError;
|
||||||
@ -19,7 +21,14 @@ use crate::rustfmt::{
|
|||||||
FormatReportFormatterBuilder, Input, Session, Verbosity,
|
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() {
|
fn main() {
|
||||||
|
rustc_driver::install_ice_hook(BUG_REPORT_URL, |_| ());
|
||||||
|
|
||||||
env_logger::Builder::from_env("RUSTFMT_LOG").init();
|
env_logger::Builder::from_env("RUSTFMT_LOG").init();
|
||||||
let opts = make_opts();
|
let opts = make_opts();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user