Skip to content

Commit

Permalink
Rollup merge of rust-lang#53370 - jkozlowski:stabilize-macro_vis_matc…
Browse files Browse the repository at this point in the history
…her, 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
  • Loading branch information
kennytm committed Aug 21, 2018
2 parents ffde96c + 00920c0 commit f9e3af7
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 82 deletions.
14 changes: 0 additions & 14 deletions src/doc/unstable-book/src/language-features/macro-vis-matcher.md

This file was deleted.

1 change: 0 additions & 1 deletion src/doc/unstable-book/src/language-features/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![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)]
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
#![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))]
Expand Down
14 changes: 1 addition & 13 deletions src/libsyntax/ext/tt/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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,
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,6 @@ declare_features! (
// 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),

Expand Down Expand Up @@ -648,6 +645,8 @@ declare_features! (
(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),
Expand Down Expand Up @@ -1363,9 +1362,6 @@ pub const EXPLAIN_DEPR_CUSTOM_DERIVE: &'static str =
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";

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/macro-first-set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==============================================================

Expand Down
3 changes: 2 additions & 1 deletion src/test/run-pass/macro-pub-matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/auxiliary/lint_tool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 0 additions & 19 deletions src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-42755.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/unreachable_pub-pub_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// compile-pass

#![feature(macro_vis_matcher)]
#![cfg_attr(stage0, feature(macro_vis_matcher))]

#![allow(unused)]
#![warn(unreachable_pub)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/unreachable_pub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit f9e3af7

Please sign in to comment.