Skip to content

stabilize macro_lifetime_matcher #50385

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

Merged
merged 3 commits into from
May 14, 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

This file was deleted.

2 changes: 1 addition & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#![feature(from_ref)]
#![feature(fs_read_write)]
#![cfg_attr(windows, feature(libc))]
#![feature(macro_lifetime_matcher)]
Copy link
Member

Choose a reason for hiding this comment

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

You still need #![cfg_attr(stage0, feature(macro_lifetime_matcher))] for these.

#![cfg_attr(stage0, feature(macro_lifetime_matcher))]
#![feature(macro_vis_matcher)]
#![feature(never_type)]
#![feature(exhaustive_patterns)]
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_metadata/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
#![feature(box_patterns)]
#![feature(fs_read_write)]
#![feature(libc)]
#![feature(macro_lifetime_matcher)]
#![cfg_attr(stage0, feature(macro_lifetime_matcher))]
#![feature(proc_macro_internals)]
#![feature(macro_lifetime_matcher)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
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)]
#![cfg_attr(stage0, feature(macro_lifetime_matcher))]
#![allow(unused_attributes)]

#[macro_use]
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 @@ -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") {
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 @@ -396,9 +396,6 @@ declare_features! (
// 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),

Expand Down Expand Up @@ -598,6 +595,8 @@ declare_features! (
(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
Expand Down Expand Up @@ -1331,9 +1330,6 @@ pub const EXPLAIN_DERIVE_UNDERSCORE: &'static str =
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";

Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/macro-lifetime-used-with-bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/macro-lifetime-used-with-labels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// except according to those terms.

#![allow(unreachable_code)]
#![feature(macro_lifetime_matcher)]

macro_rules! x {
($a:lifetime) => {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/macro-lifetime-used-with-static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/macro-lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 0 additions & 19 deletions src/test/ui/feature-gate-macro-lifetime-matcher.rs

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/ui/macros/nonterminal-matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down