about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-26 02:08:07 +0000
committerbors <bors@rust-lang.org>2023-10-26 02:08:07 +0000
commitd9148904e0c7ff2c41e5bc355909bb67ba94c23f (patch)
tree764b7690ab86b2853f8f09cce7848bc0dbdbb96a
parent5f19fac9e7725d4bbac829cf20037ca2f5bcb82a (diff)
parentebe63cde53a8bc1a6e7fcde8b6c3dc9f51b1831b (diff)
downloadrust-d9148904e0c7ff2c41e5bc355909bb67ba94c23f.tar.gz
rust-d9148904e0c7ff2c41e5bc355909bb67ba94c23f.zip
Auto merge of #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.](https://github.com/rust-lang/compiler-team/issues/596)

![image](https://github.com/rust-lang/rust/assets/48135649/be661f05-b78a-40a9-b01d-81ad2dbdb690)
-rw-r--r--src/driver.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/driver.rs b/src/driver.rs
index 0e81419f1fa..11290f88a49 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -178,7 +178,7 @@ pub fn main() {
 
     rustc_driver::init_rustc_env_logger(&handler);
 
-    rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| {
+    let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| {
         // FIXME: this macro calls unwrap internally but is called in a panicking context!  It's not
         // as simple as moving the call from the hook to main, because `install_ice_hook` doesn't
         // accept a generic closure.
@@ -265,9 +265,11 @@ pub fn main() {
         let clippy_enabled = !cap_lints_allow && (!no_deps || in_primary_package);
         if clippy_enabled {
             args.extend(clippy_args);
-            rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks { clippy_args_var }).run()
+            rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks { clippy_args_var })
+                .set_using_internal_features(using_internal_features).run()
         } else {
-            rustc_driver::RunCompiler::new(&args, &mut RustcCallbacks { clippy_args_var }).run()
+            rustc_driver::RunCompiler::new(&args, &mut RustcCallbacks { clippy_args_var })
+                .set_using_internal_features(using_internal_features).run()
         }
     }))
 }