Repository navigation
Make the BUG_REPORT_URL configurable for tools #109486
Description
Right now, install_ice_hook hard-codes the bug report url to "https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md":
rust/compiler/rustc_driver_impl/src/lib.rs
Line 1192 in 6502613
| report_ice(info, BUG_REPORT_URL); |
For tools, this is not correct; rustdoc at least wants T-rustdoc instead of T-compiler, and other tools want different repositories altogether. I'm opening this bug here because it's relevant to all tools, even though the original context was for clippy.
Fixing this seems a little tricky since DEFAULT_HOOK can't take an argument and doesn't have access to TyCtxt, but maybe we can solve this with thread-locals or something similar?
cc @rust-lang/rustdoc @rust-lang/clippy @rust-lang/miri @rust-lang/rustfmt
_Originally posted by @ingomancer in rust-lang/rust-clippy#10529
Activity
flip1995 commentedon Mar 22, 2023
Clippy already sets its own URL, so that is already possible. However Clippy needs to do a lot to do that:
rust/src/tools/clippy/src/driver.rs
Lines 196 to 252 in 439292b
Definitely worth improving the situation here.
jyn514 commentedon Mar 22, 2023
Ah hmm, looks like the original problem was a bug in rustfix:
I'll open a separate issue there.
jyn514 commentedon Apr 29, 2023
@rust-lang/miri the way I'm implementing this requires a change to the miri subtree in rust-lang/rust. What URL would you prefer for the bug report, just https://github.com/rust-lang/miri/issues/new ?
jyn514 commentedon Apr 29, 2023
#110989 - looks like rustfmt isn't using
install_ice_hooktoday? Happy to add it, but I'll make the PR to the rust-lang/rustfmt repo instead of doing it here.saethlin commentedon Apr 29, 2023
In my experience, ICEs in Miri are just as often rustc bugs. I don't care if users report them in either place.
calebcartwright commentedon Apr 29, 2023
Do you have a ballpark feel for the size of the change? FWIW I'd be okay with making the rustfmt update in tree if it's reasonably small and logically part of a batch of related in-tree changes
jyn514 commentedon Apr 29, 2023
about 3 lines of code :) most of which will be the URL itself
calebcartwright commentedon Apr 29, 2023
sgtm, feel free to go ahead 👍
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
Rollup merge of rust-lang#110989 - jyn514:bug-report-url, r=WaffleLapkin
Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkin
Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkin
Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkin