Add a list of symbols for stable standard library crates · rust-lang/rust@933c4f5 (original) (raw)
`@@ -18,7 +18,7 @@ use rustc_lint_defs::BuiltinLintDiag;
`
18
18
`use rustc_parse::validate_attr;
`
19
19
`use rustc_session::Session;
`
20
20
`use rustc_session::parse::feature_err;
`
21
``
`-
use rustc_span::{Span, Symbol, sym};
`
``
21
`+
use rustc_span::{STDLIB_STABLE_CRATES, Span, Symbol, sym};
`
22
22
`use thin_vec::ThinVec;
`
23
23
`use tracing::instrument;
`
24
24
``
`@@ -107,14 +107,11 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
`
107
107
``
108
108
`// If the enabled feature is unstable, record it.
`
109
109
`if UNSTABLE_LANG_FEATURES.iter().find(|f| name == f.name).is_some() {
`
110
``
`-
// When the ICE comes from core, alloc or std (approximation of the standard
`
111
``
`-
// library), there's a chance that the person hitting the ICE may be using
`
112
``
`-
// -Zbuild-std or similar with an untested target. The bug is probably in the
`
113
``
`-
// standard library and not the compiler in that case, but that doesn't really
`
114
``
`-
// matter - we want a bug report.
`
115
``
`-
if features.internal(name)
`
116
``
`-
&& ![sym::core, sym::alloc, sym::std].contains(&crate_name)
`
117
``
`-
{
`
``
110
`+
// When the ICE comes a standard library crate, there's a chance that the person
`
``
111
`+
// hitting the ICE may be using -Zbuild-std or similar with an untested target.
`
``
112
`+
// The bug is probably in the standard library and not the compiler in that case,
`
``
113
`+
// but that doesn't really matter - we want a bug report.
`
``
114
`+
if features.internal(name) && !STDLIB_STABLE_CRATES.contains(&crate_name) {
`
118
115
` sess.using_internal_features.store(true, std::sync::atomic::Ordering::Relaxed);
`
119
116
`}
`
120
117
``
`@@ -133,7 +130,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
`
133
130
``
134
131
`// Similar to above, detect internal lib features to suppress
`
135
132
`// the ICE message that asks for a report.
`
136
``
`-
if features.internal(name) && ![sym::core, sym::alloc, sym::std].contains(&crate_name) {
`
``
133
`+
if features.internal(name) && !STDLIB_STABLE_CRATES.contains(&crate_name) {
`
137
134
` sess.using_internal_features.store(true, std::sync::atomic::Ordering::Relaxed);
`
138
135
`}
`
139
136
`}
`