]> git.lizzy.rs Git - rust.git/commitdiff
stabilize :lifetime
authorAlex Burka <alex@alexburka.com>
Wed, 2 May 2018 03:02:05 +0000 (03:02 +0000)
committerAlex Burka <alex@alexburka.com>
Sun, 13 May 2018 19:51:32 +0000 (19:51 +0000)
12 files changed:
src/doc/unstable-book/src/language-features/macro-lifetime-matcher.md [deleted file]
src/librustc/lib.rs
src/librustc_metadata/lib.rs
src/librustc_save_analysis/lib.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/feature_gate.rs
src/test/run-pass/macro-lifetime-used-with-bound.rs
src/test/run-pass/macro-lifetime-used-with-labels.rs
src/test/run-pass/macro-lifetime-used-with-static.rs
src/test/run-pass/macro-lifetime.rs
src/test/ui/feature-gate-macro-lifetime-matcher.rs [deleted file]
src/test/ui/macros/nonterminal-matching.rs

diff --git a/src/doc/unstable-book/src/language-features/macro-lifetime-matcher.md b/src/doc/unstable-book/src/language-features/macro-lifetime-matcher.md
deleted file mode 100644 (file)
index 5b585d7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# `macro_lifetime_matcher`
-
-The tracking issue for this feature is: [#46895]
-
-With this feature gate enabled, the [list of fragment specifiers][frags] gains one more entry:
-
-* `lifetime`: a lifetime. Examples: 'static, 'a.
-
-A `lifetime` variable may be followed by anything.
-
-[#46895]: https://github.com/rust-lang/rust/issues/46895
-[frags]: ../book/first-edition/macros.html#syntactic-requirements
-
-------------------------
index 879d38c4894435613efa148027289b1f64281672..b9928a08131f25c703b5fc042b083ef8e7ce4acd 100644 (file)
@@ -50,7 +50,6 @@
 #![feature(from_ref)]
 #![feature(fs_read_write)]
 #![cfg_attr(windows, feature(libc))]
-#![feature(macro_lifetime_matcher)]
 #![feature(macro_vis_matcher)]
 #![feature(never_type)]
 #![feature(exhaustive_patterns)]
index a99e0a32e6645bbf017f404815efcc21c36e619c..60016a0d864517acb6dff2bac1ba82066f1692ea 100644 (file)
@@ -15,9 +15,7 @@
 #![feature(box_patterns)]
 #![feature(fs_read_write)]
 #![feature(libc)]
-#![feature(macro_lifetime_matcher)]
 #![feature(proc_macro_internals)]
-#![feature(macro_lifetime_matcher)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_sort_by_cached_key)]
index cf12302d9896978cf459ee5fb54f0e8b560ad3ef..bfcb23c1fb8910454cb27aea49e90f81bd3a162c 100644 (file)
@@ -12,7 +12,6 @@
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(custom_attribute)]
-#![feature(macro_lifetime_matcher)]
 #![allow(unused_attributes)]
 
 #[macro_use]
index 1fc5aed7e7a23896c823f16b154582ec93c3f5e5..e96a0e838cfcd50a46429727a3b3180294d1e039 100644 (file)
@@ -904,20 +904,8 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
                                frag_name: &str,
                                frag_span: Span) -> bool {
     match frag_name {
-        "item" | "block" | "stmt" | "expr" | "pat" |
+        "item" | "block" | "stmt" | "expr" | "pat" | "lifetime" |
         "path" | "ty" | "ident" | "meta" | "tt" | "" => true,
-        "lifetime" => {
-            if !features.macro_lifetime_matcher &&
-               !attr::contains_name(attrs, "allow_internal_unstable") {
-                let explain = feature_gate::EXPLAIN_LIFETIME_MATCHER;
-                emit_feature_err(sess,
-                                 "macro_lifetime_matcher",
-                                 frag_span,
-                                 GateIssue::Language,
-                                 explain);
-            }
-            true
-        },
         "literal" => {
             if !features.macro_literal_matcher &&
                !attr::contains_name(attrs, "allow_internal_unstable") {
index 562705462e2a4fc2fb8ef6c464ef9826c3e79e85..cb5125fe9ef5a25f9209cf09058e094f0f7d8d91 100644 (file)
@@ -396,9 +396,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     // Termination trait in tests (RFC 1937)
     (active, termination_trait_test, "1.24.0", Some(48854), Some(Edition::Edition2018)),
 
-    // Allows use of the :lifetime macro fragment specifier
-    (active, macro_lifetime_matcher, "1.24.0", Some(46895), None),
-
     // `extern` in paths
     (active, extern_in_paths, "1.23.0", Some(44660), None),
 
@@ -598,6 +595,8 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     (accepted, dyn_trait, "1.27.0", Some(44662), None),
     // allow `#[must_use]` on functions; and, must-use operators (RFC 1940)
     (accepted, fn_must_use, "1.27.0", Some(43302), None),
+    // Allows use of the :lifetime macro fragment specifier
+    (accepted, macro_lifetime_matcher, "1.27.0", Some(34303), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
@@ -1331,9 +1330,6 @@ fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue
 pub const EXPLAIN_VIS_MATCHER: &'static str =
     ":vis fragment specifier is experimental and subject to change";
 
-pub const EXPLAIN_LIFETIME_MATCHER: &'static str =
-    ":lifetime fragment specifier is experimental and subject to change";
-
 pub const EXPLAIN_LITERAL_MATCHER: &'static str =
     ":literal fragment specifier is experimental and subject to change";
 
index b0c9280b6ce44fb3effe9cf291f64f24296d79a7..b9e1fde6b1f3e10efb0ea203e6ad4ee7d52ca39d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_lifetime_matcher)]
-
 macro_rules! foo {
     ($l:lifetime, $l2:lifetime) => {
         fn f<$l: $l2, $l2>(arg: &$l str, arg2: &$l2 str) -> &$l str {
index 8a2d76e17df6846ada9f4cccd751b70c167ed81e..d003d7dcfb6206ba75ba87e51cfc12edac19a2ce 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![allow(unreachable_code)]
-#![feature(macro_lifetime_matcher)]
 
 macro_rules! x {
     ($a:lifetime) => {
index 468ee2e94365723690f85f750b1467be8bb9eea1..5c1f8683e00f600a6c165f660265a8f4931c57fe 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_lifetime_matcher)]
-
 macro_rules! foo {
     ($l:lifetime) => {
         fn f(arg: &$l str) -> &$l str {
index db521ca7f103fb74d101fc830bf35e9254e0f9c0..ff5798ff78d62837e9c475c21296a7577786775c 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_lifetime_matcher)]
-
 macro_rules! foo {
     ($l:lifetime) => {
         fn f<$l>(arg: &$l str) -> &$l str {
diff --git a/src/test/ui/feature-gate-macro-lifetime-matcher.rs b/src/test/ui/feature-gate-macro-lifetime-matcher.rs
deleted file mode 100644 (file)
index 0d107d2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that the :lifetime macro fragment cannot be used when macro_lifetime_matcher
-// feature gate is not used.
-
-macro_rules! m { ($lt:lifetime) => {} }
-//~^ ERROR :lifetime fragment specifier is experimental and subject to change
-
-fn main() {
-    m!('a);
-}
index 4dcb8afa94eab1564814c08140ac6b5855373477..54d280a63e7984637b095d8b3aafe0b024d2040e 100644 (file)
@@ -11,7 +11,7 @@
 // Check that we are refusing to match on complex nonterminals for which tokens are
 // unavailable and we'd have to go through AST comparisons.
 
-#![feature(decl_macro, macro_lifetime_matcher)]
+#![feature(decl_macro)]
 
 macro simple_nonterminal($nt_ident: ident, $nt_lifetime: lifetime, $nt_tt: tt) {
     macro n(a $nt_ident b $nt_lifetime c $nt_tt d) {