Un-gate macro_rules

This commit is contained in:
Keegan McAllister 2015-01-02 19:41:40 -08:00
parent d0163d3311
commit c2e26972e3
129 changed files with 15 additions and 260 deletions

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs, plugin, macro_rules)]
#![feature(globs, plugin)]
extern crate syntax;
extern crate rustc;

View file

@ -7,7 +7,7 @@
// <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.
#![feature(globs, unsafe_destructor, macro_rules, slicing_syntax, default_type_params)]
#![feature(globs, unsafe_destructor, slicing_syntax, default_type_params)]
#![feature(unboxed_closures)]
extern crate core;

View file

@ -23,7 +23,7 @@
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
#![feature(macro_rules, globs, slicing_syntax)]
#![feature(globs, slicing_syntax)]
#![feature(associated_types)]
pub use self::Piece::*;

View file

@ -37,7 +37,7 @@ use std::ascii::AsciiExt;
// if you change this list without updating src/doc/reference.md, @cmr will be sad
static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
("globs", Active),
("macro_rules", Active),
("macro_rules", Accepted),
("struct_variant", Accepted),
("asm", Active),
("managed_boxes", Removed),
@ -169,12 +169,7 @@ impl<'a, 'v> Visitor<'v> for MacroVisitor<'a> {
let ast::MacInvocTT(ref path, _, _) = mac.node;
let id = path.segments.last().unwrap().identifier;
if id == token::str_to_ident("macro_rules") {
self.context.gate_feature("macro_rules", path.span, "macro definitions are \
not stable enough for use and are subject to change");
}
else if id == token::str_to_ident("asm") {
if id == token::str_to_ident("asm") {
self.context.gate_feature("asm", path.span, "inline assembly is not \
stable enough for use and is subject to change");
}

View file

@ -32,7 +32,7 @@
html_root_url = "http://doc.rust-lang.org/nightly/")]
#![allow(unknown_features)]
#![feature(asm, macro_rules, globs, slicing_syntax)]
#![feature(asm, globs, slicing_syntax)]
#![feature(unboxed_closures, default_type_params)]
#![feature(old_orphan_check)]

View file

@ -10,8 +10,6 @@
#![crate_name="lint_stability"]
#![crate_type = "lib"]
#![feature(macro_rules)]
#[deprecated]
pub fn deprecated() {}
#[deprecated="text"]

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
#[macro_export]
macro_rules! make_a_5 {
() => (5)

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
pub fn increment(x: uint) -> uint {
x + 1
}

View file

@ -10,7 +10,7 @@
// force-host
#![feature(globs, plugin_registrar, macro_rules, quote)]
#![feature(globs, plugin_registrar, quote)]
extern crate syntax;
extern crate rustc;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
pub mod inner {
#[macro_export]
macro_rules! foo {

View file

@ -9,8 +9,6 @@
// except according to those terms.
#![crate_type = "dylib"]
#![feature(macro_rules)]
#[macro_export]
macro_rules! reexported {
() => ( 3u )

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -13,8 +13,6 @@
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![feature(macro_rules)]
#![crate_name = "a"]
macro_rules! three {

View file

@ -10,8 +10,6 @@
// force-host
#![feature(macro_rules)]
#[macro_export]
macro_rules! macro_one { () => ("one") }

View file

@ -11,7 +11,6 @@
// ignore-lexer-test FIXME #15679
// Microbenchmarks for various functions in std and extra
#![feature(macro_rules)]
#![feature(unboxed_closures)]
use std::io::File;

View file

@ -38,7 +38,6 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
#![feature(macro_rules)]
#![feature(simd)]
#![allow(experimental)]

View file

@ -41,7 +41,7 @@
// ignore-stage1
// ignore-cross-compile #12102
#![feature(macro_rules, plugin, slicing_syntax)]
#![feature(plugin, slicing_syntax)]
extern crate regex;

View file

@ -11,8 +11,6 @@
// Test that the borrow checker prevents pointers to temporaries
// with statement lifetimes from escaping.
#![feature(macro_rules)]
use std::ops::Drop;
static mut FLAGS: u64 = 0;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
static A: uint = { 1u; 2 };
//~^ ERROR: blocks in constants are limited to items and tail expressions

View file

@ -1,14 +0,0 @@
// Copyright 2013 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.
macro_rules! foo { () => () }
//~^ ERROR: macro definitions are not stable enough for use
fn main() {}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! foo {
() => { break 'x; }
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! foo {
($e: expr) => { 'x: loop { $e } }
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! foo {
() => { break 'x; }
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! foo {
($e: expr) => { 'x: for _ in range(0,1) { $e } }
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
fn macros() {
macro_rules! foo{
($p:pat, $e:expr, $b:block) => {{

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! recursive {
() => (recursive!()) //~ ERROR recursion limit reached while expanding the macro `recursive`
}

View file

@ -13,8 +13,6 @@
// error-pattern:
#![feature(macro_rules)]
macro_rules! foo{
() => {{
macro_rules! bar{() => (())}

View file

@ -15,8 +15,6 @@
// ignore-test
#![feature(macro_rules)]
macro_rules! f { () => (n) }
fn main() -> (){

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! prob1 {
(0) => {
0

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
// error-pattern: unexpected token
macro_rules! e {

View file

@ -11,8 +11,6 @@
#![allow(unused_unsafe)]
#![allow(dead_code)]
#![deny(unsafe_blocks)]
#![feature(macro_rules)]
unsafe fn allowed() {}
#[allow(unsafe_blocks)] fn also_allowed() { unsafe {} }

View file

@ -10,8 +10,6 @@
//
// regression test for #8005
#![feature(macro_rules)]
macro_rules! test { () => { fn foo() -> int { 1i; } } }
//~^ ERROR not all control paths return a value
//~^^ HELP consider removing this semicolon

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! ignored_item {
() => {
fn foo() {}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! test { ($nm:ident,
#[$a:meta],
$i:item) => (mod $nm { #![$a] $i }); }

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! test { ($a, $b) => (()); } //~ ERROR Cannot transcribe
fn main() {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! test { ($nm:ident,
#[$a:meta],
$i:item) => (mod $nm { #[$a] $i }); }

View file

@ -10,8 +10,6 @@
// forbid-output: in expansion of
#![feature(macro_rules)]
macro_rules! make_method {
($name:ident) => ( fn $name(&self) { } )
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! foo { () => ( x ) }
fn main() {

View file

@ -12,7 +12,6 @@
// deeply nested types that will fail the `Send` check by overflow
// when the recursion limit is set very low.
#![feature(macro_rules)]
#![allow(dead_code)]
#![recursion_limit="10"]

View file

@ -13,8 +13,6 @@
// aux-build:svh-b.rs
// aux-build:svh-a-change-lit.rs
#![feature(macro_rules)]
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~^ NOTE: perhaps this crate needs to be recompiled

View file

@ -13,8 +13,6 @@
// aux-build:svh-b.rs
// aux-build:svh-a-change-significant-cfg.rs
#![feature(macro_rules)]
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~^ NOTE: perhaps this crate needs to be recompiled

View file

@ -13,8 +13,6 @@
// aux-build:svh-b.rs
// aux-build:svh-a-change-trait-bound.rs
#![feature(macro_rules)]
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~^ NOTE: perhaps this crate needs to be recompiled

View file

@ -13,8 +13,6 @@
// aux-build:svh-b.rs
// aux-build:svh-a-change-type-arg.rs
#![feature(macro_rules)]
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~^ NOTE: perhaps this crate needs to be recompiled

View file

@ -13,8 +13,6 @@
// aux-build:svh-b.rs
// aux-build:svh-a-change-type-ret.rs
#![feature(macro_rules)]
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~^ NOTE: perhaps this crate needs to be recompiled

View file

@ -13,8 +13,6 @@
// aux-build:svh-b.rs
// aux-build:svh-a-change-type-static.rs
#![feature(macro_rules)]
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~^ NOTE: perhaps this crate needs to be recompiled

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules, trace_macros)]
#![feature(trace_macros)]
fn main() {
trace_macros!(); //~ ERROR trace_macros! accepts only `true` or `false`

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
fn macros() {
macro_rules! foo{
($p:pat, $e:expr, $b:block) => {{

View file

@ -111,7 +111,6 @@
// lldb-command:continue
#![feature(macro_rules)]
#![omit_gdb_pretty_printer_section]
macro_rules! trivial {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
// minimal junk
#![no_std]

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
// minimal junk
#![no_std]

View file

@ -11,8 +11,6 @@
// Check that we do not ICE when compiling this
// macro, which reuses the expression `$id`
#![feature(macro_rules)]
struct Foo {
a: int

View file

@ -13,8 +13,6 @@
// check that cfg correctly chooses between the macro impls (see also
// cfg-macros-notfoo.rs)
#![feature(macro_rules)]
#[cfg(foo)]
#[macro_use]
mod foo {

View file

@ -13,8 +13,6 @@
// check that cfg correctly chooses between the macro impls (see also
// cfg-macros-foo.rs)
#![feature(macro_rules)]
#[cfg(foo)]
#[macro_use]
mod foo {

View file

@ -11,8 +11,6 @@
// Test that the lifetime of rvalues in for loops is extended
// to the for loop itself.
#![feature(macro_rules)]
use std::ops::Drop;
static mut FLAGS: u64 = 0;

View file

@ -12,8 +12,6 @@
// statement or end of block, as appropriate given the temporary
// lifetime rules.
#![feature(macro_rules)]
use std::ops::Drop;
static mut FLAGS: u64 = 0;

View file

@ -11,8 +11,6 @@
// no-pretty-expanded
#![allow(unused_must_use, dead_code, deprecated)]
#![feature(macro_rules)]
use std::io::MemWriter;
use std::fmt;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! assert_approx_eq {
($a:expr, $b:expr) => ({
use std::num::Float;

View file

@ -11,8 +11,6 @@
// General test that function items in static blocks
// can be generated with a macro.
#![feature(macro_rules)]
struct MyType {
desc: &'static str,
data: uint,

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
mod foo {
pub trait Value {
fn value(&self) -> uint;

View file

@ -15,7 +15,6 @@
// memory, which makes for some *confusing* logs. That's why these are here
// instead of in std.
#![feature(macro_rules)]
#![reexport_test_harness_main = "test_main"]
extern crate libc;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! define_vec {
() => (
mod foo {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
#[derive(Show)]
struct Unit;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! check {
($m:ident, $t:ty, $v:expr) => {{
mod $m {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
use std::num::strconv::ExponentFormat::{ExpBin, ExpDec};
use std::num::strconv::SignificantDigits::DigMax;
use std::num::strconv::SignFormat::{SignAll, SignNeg};

View file

@ -10,8 +10,6 @@
// A test of the macro system. Can we do HTML literals?
#![feature(macro_rules)]
/*

View file

@ -10,8 +10,6 @@
// ignore-pretty: pprust doesn't print hygiene output
#![feature(macro_rules)]
macro_rules! loop_x {
($e: expr) => {
// $e shouldn't be able to interact with this 'x

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! loop_x {
($e: expr) => {
// $e shouldn't be able to interact with this 'x

View file

@ -11,7 +11,6 @@
// no-pretty-expanded unnecessary unsafe block generated
// ignore-lexer-test FIXME #15679
#![feature(macro_rules)]
#![deny(warnings)]
#![allow(unused_must_use)]

View file

@ -9,7 +9,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(globs, macro_rules, intrinsics)]
#![feature(globs, intrinsics)]
macro_rules! assert_approx_eq {
($a:expr, $b:expr) => ({

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(asm, macro_rules)]
#![feature(asm)]
type History = Vec<&'static str>;

View file

@ -10,8 +10,6 @@
// ignore-pretty
#![feature(macro_rules)]
macro_rules! third {
($e:expr) => ({let x = 2; $e[x]})
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! inner {
($e:pat ) => ($e)
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! print_hd_tl {
($field_hd:ident, $($field_tl:ident),+) => ({
print!("{}", stringify!($field_hd));

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
use std::default::Default;
pub struct X<T> {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
struct Element;
macro_rules! foo {

View file

@ -14,8 +14,6 @@
// with different mutability in macro in two methods
#![allow(unused_variable)] // unused foobar_immut + foobar_mut
#![feature(macro_rules)]
trait FooBar {}
struct Bar(i32);
struct Foo { bar: Bar }

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! sty {
($t:ty) => (stringify!($t))
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
// after fixing #9384 and implementing hygiene for match bindings,
// this now fails because the insertion of the 'y' into the match
// doesn't cause capture. Making this macro hygienic (as I've done)

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! silly_macro {
() => (
pub mod Qux {

View file

@ -10,8 +10,6 @@
// ignore-pretty
#![feature(macro_rules)]
pub trait bomb { fn boom(&self, Ident); }
pub struct S;

View file

@ -10,8 +10,6 @@
// ignore-test #9737
#![feature(macro_rules)]
macro_rules! f {
(v: $x:expr) => ( println!("{}", $x) )
}

View file

@ -10,8 +10,6 @@
// ignore-test #9383
#![feature(macro_rules)]
// shouldn't affect evaluation of $ex:
macro_rules! bad_macro {
($ex:expr) => ({(|_x| { $ex }) (9) })

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
// shouldn't affect evaluation of $ex:
macro_rules! bad_macro {
($ex:expr) => ({let _x = 9i; $ex})

View file

@ -10,8 +10,6 @@
// ignore-pretty - token trees can't pretty print
#![feature(macro_rules)]
pub fn main() {
macro_rules! mylambda_tt {

View file

@ -10,8 +10,6 @@
// ignore-pretty - token trees can't pretty print
#![feature(macro_rules)]
macro_rules! descriptions {
($name:ident is $desc:expr) => {
// Check that we will correctly expand attributes

View file

@ -10,8 +10,6 @@
// ignore-pretty - token trees can't pretty print
#![feature(macro_rules)]
macro_rules! compiles_fine {
(#[$at:meta]) => {
// test that the different types of attributes work

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! do_block{
($val:block) => {$val}
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
pub fn increment(x: uint) -> uint {
x + 1
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(macro_rules)]
macro_rules! foo2 {
() => {
"foo"

Some files were not shown because too many files have changed in this diff Show more