Skip to content

Commit d914890

Browse files
committed
Auto merge of rust-lang#116818 - Nilstrieb:stop-submitting-bug-reports, r=wesleywiser
Stop telling people to submit bugs for internal feature ICEs This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. I thought about several ways to do this but now used the explicit threading of an `Arc<AtomicBool>` through `Session`. This is not exactly incremental-safe, but this is fine, as this is set during macro expansion, which is pre-incremental, and also only affects the output of ICEs, at which point incremental correctness doesn't matter much anyways. See [MCP 620.](rust-lang/compiler-team#596) ![image](https://github.com/rust-lang/rust/assets/48135649/be661f05-b78a-40a9-b01d-81ad2dbdb690)
2 parents 5f19fac + ebe63cd commit d914890

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/driver.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub fn main() {
178178

179179
rustc_driver::init_rustc_env_logger(&handler);
180180

181-
rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| {
181+
let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| {
182182
// FIXME: this macro calls unwrap internally but is called in a panicking context! It's not
183183
// as simple as moving the call from the hook to main, because `install_ice_hook` doesn't
184184
// accept a generic closure.
@@ -265,9 +265,11 @@ pub fn main() {
265265
let clippy_enabled = !cap_lints_allow && (!no_deps || in_primary_package);
266266
if clippy_enabled {
267267
args.extend(clippy_args);
268-
rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks { clippy_args_var }).run()
268+
rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks { clippy_args_var })
269+
.set_using_internal_features(using_internal_features).run()
269270
} else {
270-
rustc_driver::RunCompiler::new(&args, &mut RustcCallbacks { clippy_args_var }).run()
271+
rustc_driver::RunCompiler::new(&args, &mut RustcCallbacks { clippy_args_var })
272+
.set_using_internal_features(using_internal_features).run()
271273
}
272274
}))
273275
}

0 commit comments

Comments
 (0)