From b5a03c75d59fe7364181bb56ccd3706a992a59a9 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 25 Jul 2024 15:13:39 -0400 Subject: [PATCH] Tell users not to file a bug when using internal library features --- compiler/rustc_expand/src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 6c02c237115c5..7ec59a1be83ed 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); + } } }