Skip to content

Commit 0dc2a95

Browse files
committed
emit feature help in cheat mode
1 parent ad81f11 commit 0dc2a95

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libsyntax/feature_gate.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,12 @@ pub fn emit_feature_err(sess: &ParseSess, feature: &str, span: Span, issue: Gate
804804
};
805805

806806
// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
807-
if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() {
808-
err.emit();
809-
return;
807+
if sess.unstable_features.is_nightly_build() {
808+
err.help(&format!("add #![feature({})] to the \
809+
crate attributes to enable",
810+
feature));
810811
}
811-
err.help(&format!("add #![feature({})] to the \
812-
crate attributes to enable",
813-
feature));
812+
814813
err.emit();
815814
}
816815

0 commit comments

Comments
 (0)