Skip to content

Commit 5d9559e

Browse files
committed
Inline and remove feature_removed function.
It has a single call site. This increases consistency because other errors within `features` are emitted directly.
1 parent 9e2cd03 commit 5d9559e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

compiler/rustc_expand/src/config.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ pub struct StripUnconfigured<'a> {
3838
}
3939

4040
pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
41-
fn feature_removed(sess: &Session, span: Span, reason: Option<&str>) {
42-
sess.emit_err(FeatureRemoved {
43-
span,
44-
reason: reason.map(|reason| FeatureRemovedReason { reason }),
45-
});
46-
}
47-
4841
fn active_features_up_to(edition: Edition) -> impl Iterator<Item = &'static Feature> {
4942
ACTIVE_FEATURES.iter().filter(move |feature| {
5043
if let Some(feature_edition) = feature.edition {
@@ -167,7 +160,10 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features {
167160
if let FeatureState::Removed { reason } | FeatureState::Stabilized { reason } =
168161
state
169162
{
170-
feature_removed(sess, mi.span(), *reason);
163+
sess.emit_err(FeatureRemoved {
164+
span: mi.span(),
165+
reason: reason.map(|reason| FeatureRemovedReason { reason }),
166+
});
171167
continue;
172168
}
173169
}

0 commit comments

Comments
 (0)