Skip to content

Commit

Permalink
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr committed May 6, 2023
2 parents 8ed5d5d + 34a71f6 commit 48e380f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(rustc_private)]

use anyhow::{format_err, Result};

use io::Error as IoError;
Expand All @@ -19,7 +21,14 @@ use crate::rustfmt::{
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();

Expand Down

0 comments on commit 48e380f

Please sign in to comment.