From 74df5ec387e40097853df9fb25318a5f501e5d99 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Mon, 8 Oct 2018 23:31:50 -0700 Subject: [PATCH] Add a stub feature so we can still test E0705 --- src/libsyntax/diagnostic_list.rs | 8 ++++---- src/libsyntax/feature_gate.rs | 3 +++ src/test/ui/E0705.rs | 7 +++++-- src/test/ui/E0705.stderr | 8 ++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index 5155ebbe19d47..cd421de5f1db4 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -375,15 +375,15 @@ and likely to change in the future. E0705: r##" A `#![feature]` attribute was declared for a feature that is stable in -the current edition. +the current edition, but not in all editions. Erroneous code example: ```ignore (limited to a warning during 2018 edition development) #![feature(rust_2018_preview)] -#![feature(impl_header_lifetime_elision)] // error: the feature - // `impl_header_lifetime_elision` is - // included in the Rust 2018 edition +#![feature(test_2018_feature)] // error: the feature + // `test_2018_feature` is + // included in the Rust 2018 edition ``` "##, diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 90a5a4cef2186..1025943deccf1 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -462,6 +462,9 @@ declare_features! ( (active, abi_amdgpu_kernel, "1.29.0", Some(51575), None), + // Perma-unstable; added for testing E0705 + (active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)), + // Support for arbitrary delimited token streams in non-macro attributes (active, unrestricted_attribute_tokens, "1.30.0", Some(44690), None), diff --git a/src/test/ui/E0705.rs b/src/test/ui/E0705.rs index 2e3492937acb9..19f9ecc26cf01 100644 --- a/src/test/ui/E0705.rs +++ b/src/test/ui/E0705.rs @@ -10,8 +10,11 @@ // compile-pass -#![feature(impl_header_lifetime_elision)] -//~^ WARN the feature `impl_header_lifetime_elision` is included in the Rust 2018 edition +// This is a stub feature that doesn't control anything, so to make tidy happy, +// gate-test-test_2018_feature + +#![feature(test_2018_feature)] +//~^ WARN the feature `test_2018_feature` is included in the Rust 2018 edition #![feature(rust_2018_preview)] fn main() {} diff --git a/src/test/ui/E0705.stderr b/src/test/ui/E0705.stderr index c40064d38d2ff..ccf8a04fdfc66 100644 --- a/src/test/ui/E0705.stderr +++ b/src/test/ui/E0705.stderr @@ -1,6 +1,6 @@ -warning[E0705]: the feature `impl_header_lifetime_elision` is included in the Rust 2018 edition - --> $DIR/E0705.rs:13:12 +warning[E0705]: the feature `test_2018_feature` is included in the Rust 2018 edition + --> $DIR/E0705.rs:16:12 | -LL | #![feature(impl_header_lifetime_elision)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![feature(test_2018_feature)] + | ^^^^^^^^^^^^^^^^^