Skip to content

Commit

Permalink
Fix stability annotations for already stable bits of proc macro API 1.1
Browse files Browse the repository at this point in the history
Remove unnecessary proc-macro-related `feature`s
  • Loading branch information
petrochenkov committed May 15, 2018
1 parent c106125 commit dab8c0a
Show file tree
Hide file tree
Showing 33 changed files with 41 additions and 48 deletions.
10 changes: 5 additions & 5 deletions src/libproc_macro/lib.rs
Expand Up @@ -73,9 +73,9 @@ use syntax_pos::hygiene::Mark;
#[derive(Clone)]
pub struct TokenStream(tokenstream::TokenStream);

#[unstable(feature = "proc_macro", issue = "38356")]
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl !Send for TokenStream {}
#[unstable(feature = "proc_macro", issue = "38356")]
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl !Sync for TokenStream {}

/// Error returned from `TokenStream::from_str`.
Expand All @@ -85,9 +85,9 @@ pub struct LexError {
_inner: (),
}

#[unstable(feature = "proc_macro", issue = "38356")]
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl !Send for LexError {}
#[unstable(feature = "proc_macro", issue = "38356")]
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl !Sync for LexError {}

impl TokenStream {
Expand Down Expand Up @@ -167,7 +167,7 @@ impl iter::FromIterator<TokenTree> for TokenStream {

/// A "flattening" operation on token streams, collects token trees
/// 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 {
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
let mut builder = tokenstream::TokenStreamBuilder::new();
Expand Down
Expand Up @@ -11,7 +11,6 @@
// force-host
// no-prefer-dynamic

#![feature(proc_macro, proc_macro_lib)]
#![crate_type = "proc-macro"]

extern crate proc_macro;
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail-fulldeps/proc-macro/issue-38586.rs
Expand Up @@ -11,8 +11,6 @@
// aux-build:issue_38586.rs
// ignore-stage1

#![feature(proc_macro)]

#[macro_use]
extern crate issue_38586;

Expand Down
Expand Up @@ -11,7 +11,7 @@
// aux-build:bang_proc_macro2.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]
#![allow(unused_macros)]

extern crate bang_proc_macro2;
Expand Down
Expand Up @@ -10,7 +10,7 @@

// aux-build:bang_proc_macro.rs

#![feature(proc_macro, proc_macro_non_items)]
#![feature(proc_macro_non_items)]

#[macro_use]
extern crate bang_proc_macro;
Expand Down
Expand Up @@ -10,7 +10,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/auxiliary/cond_plugin.rs
Expand Up @@ -33,7 +33,7 @@ pub fn cond(input: TokenStream) -> TokenStream {
panic!("Invalid macro usage in cond: {}", cond);
}
let is_else = match test {
TokenTree::Ident(word) => &*word.to_string() == "else",
TokenTree::Ident(ref word) => &*word.to_string() == "else",
_ => false,
};
conds.push(if is_else || input.peek().is_none() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/auxiliary/hello_macro.rs
Expand Up @@ -11,7 +11,7 @@
// no-prefer-dynamic

#![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;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/auxiliary/proc_macro_def.rs
Expand Up @@ -11,7 +11,7 @@
// no-prefer-dynamic

#![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;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/macro-quote-cond.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:cond_plugin.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]

extern crate cond_plugin;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/macro-quote-test.rs
Expand Up @@ -13,7 +13,7 @@
// aux-build:hello_macro.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]

extern crate hello_macro;

Expand Down
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// no-prefer-dynamic
#![feature(proc_macro)]

#![crate_type = "proc-macro"]

extern crate proc_macro;
Expand Down
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(proc_macro)]
#![feature(use_extern_macros)]

extern crate hygiene_example_codegen;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/bang-macro.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:bang-macro.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]

extern crate bang_macro;
use bang_macro::rewrite;
Expand Down
Expand Up @@ -11,7 +11,7 @@
// aux-build:count_compound_ops.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]

extern crate count_compound_ops;
use count_compound_ops::count_compound_ops;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/derive-attr-cfg.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:derive-attr-cfg.rs
// ignore-stage1

#![feature(proc_macro)]
#![feature(use_extern_macros)]

extern crate derive_attr_cfg;
use derive_attr_cfg::Foo;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/hygiene_example.rs
Expand Up @@ -12,7 +12,7 @@
// aux-build:hygiene_example.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]

extern crate hygiene_example;
use hygiene_example::hello;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/issue-39889.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:issue-39889.rs
// ignore-stage1

#![feature(proc_macro)]
#![feature(use_extern_macros)]
#![allow(unused)]

extern crate issue_39889;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/issue-40001.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:issue-40001-plugin.rs
// ignore-stage1

#![feature(proc_macro, plugin)]
#![feature(plugin)]
#![plugin(issue_40001_plugin)]

#[whitelisted_attr]
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/negative-token.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:negative-token.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(proc_macro_non_items)]

extern crate negative_token;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/proc-macro/span-api-tests.rs
Expand Up @@ -13,7 +13,7 @@

// ignore-pretty

#![feature(proc_macro)]
#![feature(use_extern_macros)]

#[macro_use]
extern crate span_test_macros;
Expand Down
1 change: 0 additions & 1 deletion src/test/ui-fulldeps/custom-derive/auxiliary/plugin.rs
Expand Up @@ -11,7 +11,6 @@
// no-prefer-dynamic

#![crate_type = "proc-macro"]
#![feature(proc_macro, proc_macro_lib)]

extern crate proc_macro;

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui-fulldeps/custom-derive/issue-36935.rs
Expand Up @@ -11,8 +11,6 @@
// aux-build:plugin.rs
// ignore-stage1

#![feature(proc_macro)]

#[macro_use] extern crate plugin;

#[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/custom-derive/issue-36935.stderr
@@ -1,5 +1,5 @@
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
| ^^^
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/invalid-punct-ident-1.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// aux-build:invalid-punct-ident.rs
#![feature(proc_macro)]

#[macro_use]
extern crate invalid_punct_ident;

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/invalid-punct-ident-2.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// aux-build:invalid-punct-ident.rs
#![feature(proc_macro)]

#[macro_use]
extern crate invalid_punct_ident;

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/invalid-punct-ident-3.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// aux-build:invalid-punct-ident.rs
#![feature(proc_macro)]

#[macro_use]
extern crate invalid_punct_ident;

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/invalid-punct-ident-4.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// aux-build:invalid-punct-ident.rs
#![feature(proc_macro)]

#[macro_use]
extern crate invalid_punct_ident;

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/proc-macro/auxiliary/three-equals.rs
Expand Up @@ -27,7 +27,7 @@ fn parse(input: TokenStream) -> Result<(), Diagnostic> {
.help("input must be: `===`"))
}

if let TokenTree::Punct(tt) = tree {
if let TokenTree::Punct(ref tt) = tree {
if tt.as_char() == '=' {
count += 1;
last_span = span;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/proc-macro/parent-source-spans.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:parent-source-spans.rs
// 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;

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/proc-macro/three-equals.rs
Expand Up @@ -11,7 +11,7 @@
// aux-build:three-equals.rs
// ignore-stage1

#![feature(proc_macro, proc_macro_non_items)]
#![feature(use_extern_macros, proc_macro_non_items)]

extern crate three_equals;

Expand Down
1 change: 0 additions & 1 deletion src/test/ui-fulldeps/resolve-error.rs
Expand Up @@ -14,7 +14,6 @@
// aux-build:bang_proc_macro.rs

#![feature(proc_macro)]
#![allow(unused_macros)]

#[macro_use]
extern crate derive_foo;
Expand Down
20 changes: 10 additions & 10 deletions src/test/ui-fulldeps/resolve-error.stderr
@@ -1,59 +1,59 @@
error: cannot find derive macro `FooWithLongNan` in this scope
--> $DIR/resolve-error.rs:37:10
--> $DIR/resolve-error.rs:36:10
|
LL | #[derive(FooWithLongNan)]
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`

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]
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`

error: cannot find attribute macro `FooWithLongNan` in this scope
--> $DIR/resolve-error.rs:45:3
--> $DIR/resolve-error.rs:44:3
|
LL | #[FooWithLongNan]
| ^^^^^^^^^^^^^^

error: cannot find derive macro `Dlone` in this scope
--> $DIR/resolve-error.rs:49:10
--> $DIR/resolve-error.rs:48:10
|
LL | #[derive(Dlone)]
| ^^^^^ help: try: `Clone`

error: cannot find derive macro `Dlona` in this scope
--> $DIR/resolve-error.rs:53:10
--> $DIR/resolve-error.rs:52:10
|
LL | #[derive(Dlona)]
| ^^^^^ help: try: `Clona`

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)]
| ^^^^^^^^^^^^^^^

error: cannot find macro `FooWithLongNama!` in this scope
--> $DIR/resolve-error.rs:62:5
--> $DIR/resolve-error.rs:61:5
|
LL | FooWithLongNama!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`

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!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`

error: cannot find macro `Dlona!` in this scope
--> $DIR/resolve-error.rs:68:5
--> $DIR/resolve-error.rs:67:5
|
LL | Dlona!();
| ^^^^^

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!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
Expand Down

0 comments on commit dab8c0a

Please sign in to comment.