about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-25 15:13:39 -0400
committerMichael Goulet <michael@errs.io>2024-07-25 15:13:49 -0400
commitb5a03c75d59fe7364181bb56ccd3706a992a59a9 (patch)
treecd0ab7cf795ff085e8c188563b1745702240e1e8 /compiler/rustc_expand/src
parenteb10639928a2781cf0a12440007fbcc1e3a6888f (diff)
downloadrust-b5a03c75d59fe7364181bb56ccd3706a992a59a9.tar.gz
rust-b5a03c75d59fe7364181bb56ccd3706a992a59a9.zip
Tell users not to file a bug when using internal library features
Diffstat (limited to 'compiler/rustc_expand/src')
-rw-r--r--compiler/rustc_expand/src/config.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs
index 6c02c237115..7ec59a1be83 100644
--- a/compiler/rustc_expand/src/config.rs
+++ b/compiler/rustc_expand/src/config.rs
@@ -117,6 +117,12 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
             // Otherwise, the feature is unknown. Record it as a lib feature.
             // It will be checked later.
             features.set_declared_lib_feature(name, mi.span());
+
+            // Similar to above, detect internal lib features to suppress
+            // the ICE message that asks for a report.
+            if features.internal(name) && ![sym::core, sym::alloc, sym::std].contains(&crate_name) {
+                sess.using_internal_features.store(true, std::sync::atomic::Ordering::Relaxed);
+            }
         }
     }