Skip to content

Commit

Permalink
emit feature help in cheat mode
Browse files Browse the repository at this point in the history
  • Loading branch information
TimNN committed Sep 26, 2016
1 parent ad81f11 commit 0dc2a95
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -804,13 +804,12 @@ pub fn emit_feature_err(sess: &ParseSess, feature: &str, span: Span, issue: Gate
};

// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() {
err.emit();
return;
if sess.unstable_features.is_nightly_build() {
err.help(&format!("add #![feature({})] to the \
crate attributes to enable",
feature));
}
err.help(&format!("add #![feature({})] to the \
crate attributes to enable",
feature));

err.emit();
}

Expand Down

0 comments on commit 0dc2a95

Please sign in to comment.