]> git.lizzy.rs Git - rust.git/commitdiff
Stabilize macro_vis_matcher
authorJakub Kozlowski <mail@jakub-kozlowski.com>
Tue, 14 Aug 2018 23:24:55 +0000 (00:24 +0100)
committerJakub Kozlowski <mail@jakub-kozlowski.com>
Sun, 19 Aug 2018 16:08:00 +0000 (17:08 +0100)
24 files changed:
src/doc/unstable-book/src/language-features/macro-vis-matcher.md [deleted file]
src/doc/unstable-book/src/language-features/plugin.md
src/librustc/lib.rs
src/librustc_data_structures/lib.rs
src/librustc_lint/lib.rs
src/librustc_mir/lib.rs
src/libstd/lib.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/feature_gate.rs
src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs
src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs
src/test/run-pass/macro-first-set.rs
src/test/run-pass/macro-pub-matcher.rs
src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs
src/test/ui-fulldeps/auxiliary/lint_tool_test.rs
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs [deleted file]
src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr [deleted file]
src/test/ui/issues/issue-42755.rs
src/test/ui/lint/unreachable_pub-pub_crate.rs
src/test/ui/lint/unreachable_pub.rs

diff --git a/src/doc/unstable-book/src/language-features/macro-vis-matcher.md b/src/doc/unstable-book/src/language-features/macro-vis-matcher.md
deleted file mode 100644 (file)
index 7918a35..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# `macro_vis_matcher`
-
-The tracking issue for this feature is: [#41022]
-
-With this feature gate enabled, the [list of fragment specifiers][frags] gains one more entry:
-
-* `vis`: a visibility qualifier. Examples: nothing (default visibility); `pub`; `pub(crate)`.
-
-A `vis` variable may be followed by a comma, ident, type, or path.
-
-[#41022]: https://github.com/rust-lang/rust/issues/41022
-[frags]: ../book/first-edition/macros.html#syntactic-requirements
-
-------------------------
index 19ece09509078d450c11f6a1efe0f09d12900139..b408d5d0805152008ed803dbd6c5fa8ef0fd5128 100644 (file)
@@ -183,7 +183,6 @@ that warns about any item named `lintme`.
 ```rust,ignore
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![feature(macro_vis_matcher)]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
index b6f4bd6dc408c9ffb4dfa10b2b7a935ad741434c..c92f7eb5954964ac8906c0696d99c82ca9ed5e49 100644 (file)
@@ -47,7 +47,7 @@
 #![feature(drain_filter)]
 #![feature(iterator_find_map)]
 #![cfg_attr(windows, feature(libc))]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(never_type)]
 #![feature(exhaustive_patterns)]
 #![feature(extern_types)]
index 5699512326a37d128936c371344808174a7b3109..c3ee48d20f6f5afad8610a4914771335e765b4c7 100644 (file)
@@ -25,7 +25,7 @@
 #![feature(unsize)]
 #![feature(specialization)]
 #![feature(optin_builtin_traits)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![cfg_attr(not(stage0), feature(nll))]
 #![feature(allow_internal_unstable)]
 #![feature(vec_resize_with)]
index 801604d1379e33f4244b34b5dce8daca9b8e3f8e..15eb4730c1d20e95190f5e41cd7f3636ce703d9f 100644 (file)
@@ -26,7 +26,7 @@
 #![cfg_attr(test, feature(test))]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![cfg_attr(not(stage0), feature(nll))]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index bda80ff562c75ede8ef6cbacc79b5982d36de066..19fc087f128031b2cbcd39c1d923ec8995f3bbef 100644 (file)
@@ -26,7 +26,7 @@
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(decl_macro)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(exhaustive_patterns)]
 #![feature(range_contains)]
 #![feature(rustc_diagnostic_macros)]
index b0069f826eefa68bb5b468ea41e1aae13912d71e..ade297219d221e73867a081517beff74175fafd6 100644 (file)
 #![feature(libc)]
 #![feature(link_args)]
 #![feature(linkage)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(needs_panic_runtime)]
 #![feature(never_type)]
 #![cfg_attr(not(stage0), feature(nll))]
index 770561fe3269a3d8228ad9f7167cf566614db4fc..2c738ac2a04cd864db459a93b3e2b4a4ed8a1d87 100644 (file)
@@ -964,7 +964,7 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
                                frag_span: Span) -> bool {
     match frag_name {
         "item" | "block" | "stmt" | "expr" | "pat" | "lifetime" |
-        "path" | "ty" | "ident" | "meta" | "tt" | "" => true,
+        "path" | "ty" | "ident" | "meta" | "tt" | "vis" | "" => true,
         "literal" => {
             if !features.macro_literal_matcher &&
                !attr::contains_name(attrs, "allow_internal_unstable") {
@@ -977,18 +977,6 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
             }
             true
         },
-        "vis" => {
-            if !features.macro_vis_matcher &&
-               !attr::contains_name(attrs, "allow_internal_unstable") {
-                let explain = feature_gate::EXPLAIN_VIS_MATCHER;
-                emit_feature_err(sess,
-                                 "macro_vis_matcher",
-                                 frag_span,
-                                 GateIssue::Language,
-                                 explain);
-            }
-            true
-        },
         _ => false,
     }
 }
index e8245a553eb485b730de0caf81f9c00addbd3570..9e80564f579f9b55b7524278fa7edef5f4b660e2 100644 (file)
@@ -342,9 +342,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     // Allows overlapping impls of marker traits
     (active, overlapping_marker_traits, "1.18.0", Some(29864), None),
 
-    // Allows use of the :vis macro fragment specifier
-    (active, macro_vis_matcher, "1.18.0", Some(41022), None),
-
     // rustc internal
     (active, abi_thiscall, "1.19.0", None, None),
 
@@ -648,6 +645,8 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     (accepted, repr_transparent, "1.28.0", Some(43036), None),
     // Defining procedural macros in `proc-macro` crates
     (accepted, proc_macro, "1.29.0", Some(38356), None),
+    // Allows use of the :vis macro fragment specifier
+    (accepted, macro_vis_matcher, "1.29.0", Some(41022), None),
     // Allows importing and reexporting macros with `use`,
     // enables macro modularization in general.
     (accepted, use_extern_macros, "1.30.0", Some(35896), None),
@@ -1363,9 +1362,6 @@ fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue
 pub const EXPLAIN_DERIVE_UNDERSCORE: &'static str =
     "attributes of the form `#[derive_*]` are reserved for the compiler";
 
-pub const EXPLAIN_VIS_MATCHER: &'static str =
-    ":vis 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 7303af73cac9ef9b17112311e519b64287230e76..c965a3ed86c82d7336d47961b9a95f69935d4f84 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(plugin_registrar, rustc_private)]
 #![feature(box_syntax)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 #[macro_use] extern crate rustc;
index 3f3997726c93996e6846bfa3a73c69ef36a2e9f2..8ccb5878c40456d449fb746836dc5697124f083f 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 // Load rustc as a plugin to get macros
index ab39709c529dcd3298361937db77ad02f761c942..315dad7eea515279f0aa1d06b15ba5ea2ded568b 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
index fa208e14b7d1c632afb41ef6b26eba6c7eba5de5..601003827c6a287a463e193bda77647ff4274a62 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(plugin_registrar, rustc_private)]
 #![feature(box_syntax)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 #[macro_use] extern crate rustc;
index 56c163b8ce3d595cc473476fcca860c77d17ee54..fe9ac5fd635bddd8514303770d80fb80d3cff291 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 #![crate_type = "dylib"]
 
index c371a33257f4e3fe373e81a9b6b78dd232d8d263..9216040ab6ec892b7c7b5f500aedf768d6c757dd 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 //{{{ issue 40569 ==============================================================
 
index 32145277252cb89df22f3283b56cbcc92b405986..db8331358b96e31ddcfd084830f11bfe897f4e9d 100644 (file)
@@ -9,7 +9,8 @@
 // except according to those terms.
 
 #![allow(dead_code, unused_imports)]
-#![feature(macro_vis_matcher, crate_visibility_modifier)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
+#![feature(crate_visibility_modifier)]
 
 /**
 Ensure that `:vis` matches can be captured in existing positions, and passed
index 3f3997726c93996e6846bfa3a73c69ef36a2e9f2..8ccb5878c40456d449fb746836dc5697124f083f 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 // Load rustc as a plugin to get macros
index ab39709c529dcd3298361937db77ad02f761c942..315dad7eea515279f0aa1d06b15ba5ea2ded568b 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
index 01fa2f3459ea71d4a6cb1c6897c1f4042c25b802..d7895bd8781ba02b83fcb3eb45031184e3361373 100644 (file)
@@ -10,7 +10,7 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
diff --git a/src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs b/src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs
deleted file mode 100644 (file)
index 5d6f2ac..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 MSP430 interrupt ABI cannot be used when msp430_interrupt
-// feature gate is not used.
-
-macro_rules! m { ($v:vis) => {} }
-//~^ ERROR :vis fragment specifier is experimental and subject to change
-
-fn main() {
-    m!(pub);
-}
diff --git a/src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr b/src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr
deleted file mode 100644 (file)
index 9d98091..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: :vis fragment specifier is experimental and subject to change (see issue #41022)
-  --> $DIR/feature-gate-macro-vis-matcher.rs:14:19
-   |
-LL | macro_rules! m { ($v:vis) => {} }
-   |                   ^^^^^^
-   |
-   = help: add #![feature(macro_vis_matcher)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
index 7547c4a17beba30e3edb1b8c6df585b7726d073c..dd53a1c71a5bce538a8474502bc15c60457d5957 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 macro_rules! foo {
     ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree
index 0a1926f8ae56a11dd9ad7f91881d37c3827cbbde..0089617b11c0b9a84e1c3f5db6b8731694185a69 100644 (file)
@@ -16,7 +16,7 @@
 
 // compile-pass
 
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 #![allow(unused)]
 #![warn(unreachable_pub)]
index 5bb67670d85c2ae6f9bcfa708e28c944ed82f2c4..7fd4a901090711bcfaf666bf456533ca5d9128a3 100644 (file)
@@ -11,7 +11,7 @@
 // compile-pass
 
 #![feature(crate_visibility_modifier)]
-#![feature(macro_vis_matcher)]
+#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 #![allow(unused)]
 #![warn(unreachable_pub)]