mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fix stability annotations for already stable bits of proc macro API 1.1
Remove unnecessary proc-macro-related `feature`s
This commit is contained in:
parent
c106125431
commit
dab8c0ab28
@ -73,9 +73,9 @@ use syntax_pos::hygiene::Mark;
|
|||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct TokenStream(tokenstream::TokenStream);
|
pub struct TokenStream(tokenstream::TokenStream);
|
||||||
|
|
||||||
#[unstable(feature = "proc_macro", issue = "38356")]
|
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
||||||
impl !Send for TokenStream {}
|
impl !Send for TokenStream {}
|
||||||
#[unstable(feature = "proc_macro", issue = "38356")]
|
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
||||||
impl !Sync for TokenStream {}
|
impl !Sync for TokenStream {}
|
||||||
|
|
||||||
/// Error returned from `TokenStream::from_str`.
|
/// Error returned from `TokenStream::from_str`.
|
||||||
@ -85,9 +85,9 @@ pub struct LexError {
|
|||||||
_inner: (),
|
_inner: (),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(feature = "proc_macro", issue = "38356")]
|
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
||||||
impl !Send for LexError {}
|
impl !Send for LexError {}
|
||||||
#[unstable(feature = "proc_macro", issue = "38356")]
|
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
||||||
impl !Sync for LexError {}
|
impl !Sync for LexError {}
|
||||||
|
|
||||||
impl TokenStream {
|
impl TokenStream {
|
||||||
@ -167,7 +167,7 @@ impl iter::FromIterator<TokenTree> for TokenStream {
|
|||||||
|
|
||||||
/// A "flattening" operation on token streams, collects token trees
|
/// A "flattening" operation on token streams, collects token trees
|
||||||
/// from multiple token streams into a single stream.
|
/// from multiple token streams into a single stream.
|
||||||
#[unstable(feature = "proc_macro", issue = "38356")]
|
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
||||||
impl iter::FromIterator<TokenStream> for TokenStream {
|
impl iter::FromIterator<TokenStream> for TokenStream {
|
||||||
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
|
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
|
||||||
let mut builder = tokenstream::TokenStreamBuilder::new();
|
let mut builder = tokenstream::TokenStreamBuilder::new();
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
// force-host
|
// force-host
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_lib)]
|
|
||||||
#![crate_type = "proc-macro"]
|
#![crate_type = "proc-macro"]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
// aux-build:issue_38586.rs
|
// aux-build:issue_38586.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate issue_38586;
|
extern crate issue_38586;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:bang_proc_macro2.rs
|
// aux-build:bang_proc_macro2.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
#![allow(unused_macros)]
|
#![allow(unused_macros)]
|
||||||
|
|
||||||
extern crate bang_proc_macro2;
|
extern crate bang_proc_macro2;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// aux-build:bang_proc_macro.rs
|
// aux-build:bang_proc_macro.rs
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(proc_macro_non_items)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate bang_proc_macro;
|
extern crate bang_proc_macro;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// aux-build:proc-macro-gates.rs
|
// aux-build:proc-macro-gates.rs
|
||||||
|
|
||||||
#![feature(proc_macro, stmt_expr_attributes)]
|
#![feature(use_extern_macros, stmt_expr_attributes)]
|
||||||
|
|
||||||
extern crate proc_macro_gates as foo;
|
extern crate proc_macro_gates as foo;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ pub fn cond(input: TokenStream) -> TokenStream {
|
|||||||
panic!("Invalid macro usage in cond: {}", cond);
|
panic!("Invalid macro usage in cond: {}", cond);
|
||||||
}
|
}
|
||||||
let is_else = match test {
|
let is_else = match test {
|
||||||
TokenTree::Ident(word) => &*word.to_string() == "else",
|
TokenTree::Ident(ref word) => &*word.to_string() == "else",
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
conds.push(if is_else || input.peek().is_none() {
|
conds.push(if is_else || input.peek().is_none() {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
#![crate_type = "proc-macro"]
|
#![crate_type = "proc-macro"]
|
||||||
#![feature(proc_macro, proc_macro_lib, proc_macro_non_items)]
|
#![feature(proc_macro, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
#![crate_type = "proc-macro"]
|
#![crate_type = "proc-macro"]
|
||||||
#![feature(proc_macro, proc_macro_lib, proc_macro_non_items)]
|
#![feature(proc_macro, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:cond_plugin.rs
|
// aux-build:cond_plugin.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate cond_plugin;
|
extern crate cond_plugin;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// aux-build:hello_macro.rs
|
// aux-build:hello_macro.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate hello_macro;
|
extern crate hello_macro;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
#![feature(proc_macro)]
|
|
||||||
#![crate_type = "proc-macro"]
|
#![crate_type = "proc-macro"]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
#![feature(use_extern_macros)]
|
||||||
|
|
||||||
extern crate hygiene_example_codegen;
|
extern crate hygiene_example_codegen;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:bang-macro.rs
|
// aux-build:bang-macro.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate bang_macro;
|
extern crate bang_macro;
|
||||||
use bang_macro::rewrite;
|
use bang_macro::rewrite;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:count_compound_ops.rs
|
// aux-build:count_compound_ops.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate count_compound_ops;
|
extern crate count_compound_ops;
|
||||||
use count_compound_ops::count_compound_ops;
|
use count_compound_ops::count_compound_ops;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:derive-attr-cfg.rs
|
// aux-build:derive-attr-cfg.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
#![feature(use_extern_macros)]
|
||||||
|
|
||||||
extern crate derive_attr_cfg;
|
extern crate derive_attr_cfg;
|
||||||
use derive_attr_cfg::Foo;
|
use derive_attr_cfg::Foo;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// aux-build:hygiene_example.rs
|
// aux-build:hygiene_example.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate hygiene_example;
|
extern crate hygiene_example;
|
||||||
use hygiene_example::hello;
|
use hygiene_example::hello;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:issue-39889.rs
|
// aux-build:issue-39889.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
#![feature(use_extern_macros)]
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
extern crate issue_39889;
|
extern crate issue_39889;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:issue-40001-plugin.rs
|
// aux-build:issue-40001-plugin.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, plugin)]
|
#![feature(plugin)]
|
||||||
#![plugin(issue_40001_plugin)]
|
#![plugin(issue_40001_plugin)]
|
||||||
|
|
||||||
#[whitelisted_attr]
|
#[whitelisted_attr]
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:negative-token.rs
|
// aux-build:negative-token.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate negative_token;
|
extern crate negative_token;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
// ignore-pretty
|
// ignore-pretty
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
#![feature(use_extern_macros)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate span_test_macros;
|
extern crate span_test_macros;
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
#![crate_type = "proc-macro"]
|
#![crate_type = "proc-macro"]
|
||||||
#![feature(proc_macro, proc_macro_lib)]
|
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
// aux-build:plugin.rs
|
// aux-build:plugin.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
|
||||||
|
|
||||||
#[macro_use] extern crate plugin;
|
#[macro_use] extern crate plugin;
|
||||||
|
|
||||||
#[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
|
#[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: proc-macro derive panicked
|
error: proc-macro derive panicked
|
||||||
--> $DIR/issue-36935.rs:18:15
|
--> $DIR/issue-36935.rs:16:15
|
||||||
|
|
|
|
||||||
LL | #[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
|
LL | #[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
|
||||||
| ^^^
|
| ^^^
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:invalid-punct-ident.rs
|
// aux-build:invalid-punct-ident.rs
|
||||||
#![feature(proc_macro)]
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate invalid_punct_ident;
|
extern crate invalid_punct_ident;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:invalid-punct-ident.rs
|
// aux-build:invalid-punct-ident.rs
|
||||||
#![feature(proc_macro)]
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate invalid_punct_ident;
|
extern crate invalid_punct_ident;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:invalid-punct-ident.rs
|
// aux-build:invalid-punct-ident.rs
|
||||||
#![feature(proc_macro)]
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate invalid_punct_ident;
|
extern crate invalid_punct_ident;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:invalid-punct-ident.rs
|
// aux-build:invalid-punct-ident.rs
|
||||||
#![feature(proc_macro)]
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate invalid_punct_ident;
|
extern crate invalid_punct_ident;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ fn parse(input: TokenStream) -> Result<(), Diagnostic> {
|
|||||||
.help("input must be: `===`"))
|
.help("input must be: `===`"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if let TokenTree::Punct(tt) = tree {
|
if let TokenTree::Punct(ref tt) = tree {
|
||||||
if tt.as_char() == '=' {
|
if tt.as_char() == '=' {
|
||||||
count += 1;
|
count += 1;
|
||||||
last_span = span;
|
last_span = span;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:parent-source-spans.rs
|
// aux-build:parent-source-spans.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, decl_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, decl_macro, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate parent_source_spans;
|
extern crate parent_source_spans;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// aux-build:three-equals.rs
|
// aux-build:three-equals.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
|
||||||
#![feature(proc_macro, proc_macro_non_items)]
|
#![feature(use_extern_macros, proc_macro_non_items)]
|
||||||
|
|
||||||
extern crate three_equals;
|
extern crate three_equals;
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
// aux-build:bang_proc_macro.rs
|
// aux-build:bang_proc_macro.rs
|
||||||
|
|
||||||
#![feature(proc_macro)]
|
#![feature(proc_macro)]
|
||||||
#![allow(unused_macros)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate derive_foo;
|
extern crate derive_foo;
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
error: cannot find derive macro `FooWithLongNan` in this scope
|
error: cannot find derive macro `FooWithLongNan` in this scope
|
||||||
--> $DIR/resolve-error.rs:37:10
|
--> $DIR/resolve-error.rs:36:10
|
||||||
|
|
|
|
||||||
LL | #[derive(FooWithLongNan)]
|
LL | #[derive(FooWithLongNan)]
|
||||||
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
|
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
|
||||||
|
|
||||||
error: cannot find attribute macro `attr_proc_macra` in this scope
|
error: cannot find attribute macro `attr_proc_macra` in this scope
|
||||||
--> $DIR/resolve-error.rs:41:3
|
--> $DIR/resolve-error.rs:40:3
|
||||||
|
|
|
|
||||||
LL | #[attr_proc_macra]
|
LL | #[attr_proc_macra]
|
||||||
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
|
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
|
||||||
|
|
||||||
error: cannot find attribute macro `FooWithLongNan` in this scope
|
error: cannot find attribute macro `FooWithLongNan` in this scope
|
||||||
--> $DIR/resolve-error.rs:45:3
|
--> $DIR/resolve-error.rs:44:3
|
||||||
|
|
|
|
||||||
LL | #[FooWithLongNan]
|
LL | #[FooWithLongNan]
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: cannot find derive macro `Dlone` in this scope
|
error: cannot find derive macro `Dlone` in this scope
|
||||||
--> $DIR/resolve-error.rs:49:10
|
--> $DIR/resolve-error.rs:48:10
|
||||||
|
|
|
|
||||||
LL | #[derive(Dlone)]
|
LL | #[derive(Dlone)]
|
||||||
| ^^^^^ help: try: `Clone`
|
| ^^^^^ help: try: `Clone`
|
||||||
|
|
||||||
error: cannot find derive macro `Dlona` in this scope
|
error: cannot find derive macro `Dlona` in this scope
|
||||||
--> $DIR/resolve-error.rs:53:10
|
--> $DIR/resolve-error.rs:52:10
|
||||||
|
|
|
|
||||||
LL | #[derive(Dlona)]
|
LL | #[derive(Dlona)]
|
||||||
| ^^^^^ help: try: `Clona`
|
| ^^^^^ help: try: `Clona`
|
||||||
|
|
||||||
error: cannot find derive macro `attr_proc_macra` in this scope
|
error: cannot find derive macro `attr_proc_macra` in this scope
|
||||||
--> $DIR/resolve-error.rs:57:10
|
--> $DIR/resolve-error.rs:56:10
|
||||||
|
|
|
|
||||||
LL | #[derive(attr_proc_macra)]
|
LL | #[derive(attr_proc_macra)]
|
||||||
| ^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: cannot find macro `FooWithLongNama!` in this scope
|
error: cannot find macro `FooWithLongNama!` in this scope
|
||||||
--> $DIR/resolve-error.rs:62:5
|
--> $DIR/resolve-error.rs:61:5
|
||||||
|
|
|
|
||||||
LL | FooWithLongNama!();
|
LL | FooWithLongNama!();
|
||||||
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`
|
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`
|
||||||
|
|
||||||
error: cannot find macro `attr_proc_macra!` in this scope
|
error: cannot find macro `attr_proc_macra!` in this scope
|
||||||
--> $DIR/resolve-error.rs:65:5
|
--> $DIR/resolve-error.rs:64:5
|
||||||
|
|
|
|
||||||
LL | attr_proc_macra!();
|
LL | attr_proc_macra!();
|
||||||
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`
|
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`
|
||||||
|
|
||||||
error: cannot find macro `Dlona!` in this scope
|
error: cannot find macro `Dlona!` in this scope
|
||||||
--> $DIR/resolve-error.rs:68:5
|
--> $DIR/resolve-error.rs:67:5
|
||||||
|
|
|
|
||||||
LL | Dlona!();
|
LL | Dlona!();
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error: cannot find macro `bang_proc_macrp!` in this scope
|
error: cannot find macro `bang_proc_macrp!` in this scope
|
||||||
--> $DIR/resolve-error.rs:71:5
|
--> $DIR/resolve-error.rs:70:5
|
||||||
|
|
|
|
||||||
LL | bang_proc_macrp!();
|
LL | bang_proc_macrp!();
|
||||||
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
|
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
|
||||||
|
Loading…
Reference in New Issue
Block a user