Skip to content

Commit f9e3af7

Browse files
committed
Rollup merge of rust-lang#53370 - jkozlowski:stabilize-macro_vis_matcher, r=cramertj
Stabilize macro_vis_matcher This PR should stabilize [macro_vis_matcher](rust-lang#41022) feature. - [ ] "reference" book changes: rust-lang/reference#400 - [ ] "Rust by example" book changes: rust-lang/rust-by-example#1096 - [ ] "clippy" changes: rust-lang/rust-clippy#3055 r? @cramertj
2 parents ffde96c + 00920c0 commit f9e3af7

File tree

24 files changed

+22
-82
lines changed

24 files changed

+22
-82
lines changed

src/doc/unstable-book/src/language-features/macro-vis-matcher.md

-14
This file was deleted.

src/doc/unstable-book/src/language-features/plugin.md

-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ that warns about any item named `lintme`.
183183
```rust,ignore
184184
#![feature(plugin_registrar)]
185185
#![feature(box_syntax, rustc_private)]
186-
#![feature(macro_vis_matcher)]
187186
#![feature(macro_at_most_once_rep)]
188187
189188
extern crate syntax;

src/librustc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#![feature(drain_filter)]
4848
#![feature(iterator_find_map)]
4949
#![cfg_attr(windows, feature(libc))]
50-
#![feature(macro_vis_matcher)]
50+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
5151
#![feature(never_type)]
5252
#![feature(exhaustive_patterns)]
5353
#![feature(extern_types)]

src/librustc_data_structures/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#![feature(unsize)]
2626
#![feature(specialization)]
2727
#![feature(optin_builtin_traits)]
28-
#![feature(macro_vis_matcher)]
28+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
2929
#![cfg_attr(not(stage0), feature(nll))]
3030
#![feature(allow_internal_unstable)]
3131
#![feature(vec_resize_with)]

src/librustc_lint/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#![cfg_attr(test, feature(test))]
2727
#![feature(box_patterns)]
2828
#![feature(box_syntax)]
29-
#![feature(macro_vis_matcher)]
29+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
3030
#![cfg_attr(not(stage0), feature(nll))]
3131
#![feature(quote)]
3232
#![feature(rustc_diagnostic_macros)]

src/librustc_mir/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2626
#![feature(const_fn)]
2727
#![feature(core_intrinsics)]
2828
#![feature(decl_macro)]
29-
#![feature(macro_vis_matcher)]
29+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
3030
#![feature(exhaustive_patterns)]
3131
#![feature(range_contains)]
3232
#![feature(rustc_diagnostic_macros)]

src/libstd/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
#![feature(libc)]
271271
#![feature(link_args)]
272272
#![feature(linkage)]
273-
#![feature(macro_vis_matcher)]
273+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
274274
#![feature(needs_panic_runtime)]
275275
#![feature(never_type)]
276276
#![cfg_attr(not(stage0), feature(nll))]

src/libsyntax/ext/tt/macro_rules.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
964964
frag_span: Span) -> bool {
965965
match frag_name {
966966
"item" | "block" | "stmt" | "expr" | "pat" | "lifetime" |
967-
"path" | "ty" | "ident" | "meta" | "tt" | "" => true,
967+
"path" | "ty" | "ident" | "meta" | "tt" | "vis" | "" => true,
968968
"literal" => {
969969
if !features.macro_literal_matcher &&
970970
!attr::contains_name(attrs, "allow_internal_unstable") {
@@ -977,18 +977,6 @@ fn is_legal_fragment_specifier(sess: &ParseSess,
977977
}
978978
true
979979
},
980-
"vis" => {
981-
if !features.macro_vis_matcher &&
982-
!attr::contains_name(attrs, "allow_internal_unstable") {
983-
let explain = feature_gate::EXPLAIN_VIS_MATCHER;
984-
emit_feature_err(sess,
985-
"macro_vis_matcher",
986-
frag_span,
987-
GateIssue::Language,
988-
explain);
989-
}
990-
true
991-
},
992980
_ => false,
993981
}
994982
}

src/libsyntax/feature_gate.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,6 @@ declare_features! (
342342
// Allows overlapping impls of marker traits
343343
(active, overlapping_marker_traits, "1.18.0", Some(29864), None),
344344

345-
// Allows use of the :vis macro fragment specifier
346-
(active, macro_vis_matcher, "1.18.0", Some(41022), None),
347-
348345
// rustc internal
349346
(active, abi_thiscall, "1.19.0", None, None),
350347

@@ -648,6 +645,8 @@ declare_features! (
648645
(accepted, repr_transparent, "1.28.0", Some(43036), None),
649646
// Defining procedural macros in `proc-macro` crates
650647
(accepted, proc_macro, "1.29.0", Some(38356), None),
648+
// Allows use of the :vis macro fragment specifier
649+
(accepted, macro_vis_matcher, "1.29.0", Some(41022), None),
651650
// Allows importing and reexporting macros with `use`,
652651
// enables macro modularization in general.
653652
(accepted, use_extern_macros, "1.30.0", Some(35896), None),
@@ -1363,9 +1362,6 @@ pub const EXPLAIN_DEPR_CUSTOM_DERIVE: &'static str =
13631362
pub const EXPLAIN_DERIVE_UNDERSCORE: &'static str =
13641363
"attributes of the form `#[derive_*]` are reserved for the compiler";
13651364

1366-
pub const EXPLAIN_VIS_MATCHER: &'static str =
1367-
":vis fragment specifier is experimental and subject to change";
1368-
13691365
pub const EXPLAIN_LITERAL_MATCHER: &'static str =
13701366
":literal fragment specifier is experimental and subject to change";
13711367

src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![feature(plugin_registrar, rustc_private)]
1414
#![feature(box_syntax)]
15-
#![feature(macro_vis_matcher)]
15+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1616
#![feature(macro_at_most_once_rep)]
1717

1818
#[macro_use] extern crate rustc;

src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![feature(plugin_registrar)]
1414
#![feature(box_syntax, rustc_private)]
15-
#![feature(macro_vis_matcher)]
15+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1616
#![feature(macro_at_most_once_rep)]
1717

1818
// Load rustc as a plugin to get macros

src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![feature(plugin_registrar)]
1414
#![feature(box_syntax, rustc_private)]
15-
#![feature(macro_vis_matcher)]
15+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1616
#![feature(macro_at_most_once_rep)]
1717

1818
extern crate syntax;

src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![feature(plugin_registrar, rustc_private)]
1414
#![feature(box_syntax)]
15-
#![feature(macro_vis_matcher)]
15+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1616
#![feature(macro_at_most_once_rep)]
1717

1818
#[macro_use] extern crate rustc;

src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
12-
#![feature(macro_vis_matcher)]
12+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1313
#![feature(macro_at_most_once_rep)]
1414
#![crate_type = "dylib"]
1515

src/test/run-pass/macro-first-set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(macro_vis_matcher)]
11+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1212

1313
//{{{ issue 40569 ==============================================================
1414

src/test/run-pass/macro-pub-matcher.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// except according to those terms.
1010

1111
#![allow(dead_code, unused_imports)]
12-
#![feature(macro_vis_matcher, crate_visibility_modifier)]
12+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
13+
#![feature(crate_visibility_modifier)]
1314

1415
/**
1516
Ensure that `:vis` matches can be captured in existing positions, and passed

src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![feature(plugin_registrar)]
1414
#![feature(box_syntax, rustc_private)]
15-
#![feature(macro_vis_matcher)]
15+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1616
#![feature(macro_at_most_once_rep)]
1717

1818
// Load rustc as a plugin to get macros

src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![feature(plugin_registrar)]
1414
#![feature(box_syntax, rustc_private)]
15-
#![feature(macro_vis_matcher)]
15+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1616
#![feature(macro_at_most_once_rep)]
1717

1818
extern crate syntax;

src/test/ui-fulldeps/auxiliary/lint_tool_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#![feature(plugin_registrar)]
1212
#![feature(box_syntax, rustc_private)]
13-
#![feature(macro_vis_matcher)]
13+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1414
#![feature(macro_at_most_once_rep)]
1515

1616
extern crate syntax;

src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs

-19
This file was deleted.

src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr

-11
This file was deleted.

src/test/ui/issues/issue-42755.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(macro_vis_matcher)]
11+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1212

1313
macro_rules! foo {
1414
($($p:vis)*) => {} //~ ERROR repetition matches empty token tree

src/test/ui/lint/unreachable_pub-pub_crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
// compile-pass
1818

19-
#![feature(macro_vis_matcher)]
19+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
2020

2121
#![allow(unused)]
2222
#![warn(unreachable_pub)]

src/test/ui/lint/unreachable_pub.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// compile-pass
1212

1313
#![feature(crate_visibility_modifier)]
14-
#![feature(macro_vis_matcher)]
14+
#![cfg_attr(stage0, feature(macro_vis_matcher))]
1515

1616
#![allow(unused)]
1717
#![warn(unreachable_pub)]

0 commit comments

Comments
 (0)