Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize macro_vis_matcher #53370

Merged
merged 1 commit into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than removing these feature gates, they need to be changed to #![cfg_attr(stage0, feature(macro_vis_matcher))] so that the old compiler can compile current the current rustc.

Copy link
Contributor Author

@jkozlowski jkozlowski Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, reading comprehension is not my strong suit apparently. Hopefully fixed up now, let's see what CI says

#![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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be 1.30.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry: I wondered about this after rebasing on top of master, but forge instructions said to look at forge for the next stable and that was 1.29.

Shall I send a PR to fix this up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinging reviewer: @cramertj

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure-- a PR to bump the version number would be appreciated 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for missing this the first time around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cramertj sorry about that, here's the PR: #53702

// 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