]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor
authorCorey Farwell <coreyf@rwell.org>
Fri, 17 Aug 2018 15:23:44 +0000 (08:23 -0700)
committerGitHub <noreply@github.com>
Fri, 17 Aug 2018 15:23:44 +0000 (08:23 -0700)
Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.

cc @varkor @petrochenkov @joshtriplett

1  2 
src/libsyntax/feature_gate.rs

index 395e5c98652326091ed5ce6f79d573698426722c,dcae9b1e9ca7eabfa494328cb63d7100266b7364..7a8a7b073185a6477dfeb8fdbb73dec1995d1202
@@@ -1960,24 -1959,12 +1966,22 @@@ pub fn get_features(span_handler: &Hand
                  continue
              };
  
 +            if incomplete_features.iter().any(|f| *f == name.as_str()) {
 +                span_handler.struct_span_warn(
 +                    mi.span,
 +                    &format!(
 +                        "the feature `{}` is incomplete and may cause the compiler to crash",
 +                        name
 +                    )
 +                ).emit();
 +            }
 +
              if let Some(edition) = ALL_EDITIONS.iter().find(|e| name == e.feature_name()) {
                  if *edition <= crate_edition {
-                     continue
+                     continue;
                  }
  
-                 for &(name, .., f_edition, set) in ACTIVE_FEATURES.iter() {
+                 for &(name, .., f_edition, set) in ACTIVE_FEATURES {
                      if let Some(f_edition) = f_edition {
                          if f_edition <= *edition {
                              // FIXME(Manishearth) there is currently no way to set