diff options
| author | bors <bors@rust-lang.org> | 2018-05-07 14:54:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-07 14:54:17 +0000 |
| commit | 565235ee7e2d978e98b84450e15f673c84123a8a (patch) | |
| tree | 99e5a6fbe87202d25d4c8842d8fb040c5ac4b3d2 /src/libsyntax | |
| parent | 62889702c9868682a3112a19c75321508d9eb6e6 (diff) | |
| parent | ae4b38ea66523b685b95748e448067724b2995dd (diff) | |
| download | rust-565235ee7e2d978e98b84450e15f673c84123a8a.tar.gz rust-565235ee7e2d978e98b84450e15f673c84123a8a.zip | |
Auto merge of #50454 - Manishearth:edition-preview-fixes, r=alexcrichton
Various edition preview fixes Implement a bunch of things discussed in the meeting.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/edition.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/libsyntax/edition.rs b/src/libsyntax/edition.rs index 3fc1c279f5a..7341941c242 100644 --- a/src/libsyntax/edition.rs +++ b/src/libsyntax/edition.rs @@ -50,8 +50,8 @@ impl fmt::Display for Edition { impl Edition { pub fn lint_name(&self) -> &'static str { match *self { - Edition::Edition2015 => "edition_2015", - Edition::Edition2018 => "edition_2018", + Edition::Edition2015 => "rust_2015_breakage", + Edition::Edition2018 => "rust_2018_breakage", } } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index d8db76a95ff..5155408ba63 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -300,7 +300,7 @@ declare_features! ( (active, abi_unadjusted, "1.16.0", None, None), // Procedural macros 2.0. - (active, proc_macro, "1.16.0", Some(38356), None), + (active, proc_macro, "1.16.0", Some(38356), Some(Edition::Edition2018)), // Declarative macros 2.0 (`macro`). (active, decl_macro, "1.17.0", Some(39412), None), @@ -324,7 +324,7 @@ declare_features! ( // Allows the `catch {...}` expression - (active, catch_expr, "1.17.0", Some(31436), None), + (active, catch_expr, "1.17.0", Some(31436), Some(Edition::Edition2018)), // Used to preserve symbols (see llvm.used) (active, used, "1.18.0", Some(40289), None), @@ -1848,6 +1848,14 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], let mut feature_checker = FeatureChecker::default(); + for &(.., f_edition, set) in ACTIVE_FEATURES.iter() { + if let Some(f_edition) = f_edition { + if f_edition <= crate_edition { + set(&mut features, DUMMY_SP); + } + } + } + for attr in krate_attrs { if !attr.check_name("feature") { continue |
