rustc: Rename rustc_macro to proc_macro

This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`,
which reflects the general consensus of #35900. A follow up PR to Cargo will be
required to purge the `rustc-macro` name as well.
This commit is contained in:
Alex Crichton 2016-10-03 09:49:39 -07:00
parent 7a26aeca77
commit 2148bdfcc7
86 changed files with 613 additions and 615 deletions

View file

@ -8,15 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
extern crate rustc_macro;
extern crate proc_macro;
pub mod a { //~ `rustc-macro` crate types cannot export any items
use rustc_macro::TokenStream;
pub mod a { //~ `proc-macro` crate types cannot export any items
use proc_macro::TokenStream;
#[rustc_macro_derive(B)]
#[proc_macro_derive(B)]
pub fn bar(a: TokenStream) -> TokenStream {
//~^ ERROR: must currently reside in the root of the crate
a

View file

@ -0,0 +1,46 @@
// Copyright 2016 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.
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
extern crate proc_macro;
#[proc_macro_derive]
//~^ ERROR: attribute must be of form: #[proc_macro_derive(TraitName)]
pub fn foo1(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
input
}
#[proc_macro_derive = "foo"]
//~^ ERROR: attribute must be of form: #[proc_macro_derive(TraitName)]
pub fn foo2(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
input
}
#[proc_macro_derive(
a = "b"
)]
//~^^ ERROR: must only be one word
pub fn foo3(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
input
}
#[proc_macro_derive(b, c)]
//~^ ERROR: attribute must only have one argument
pub fn foo4(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
input
}
#[proc_macro_derive(d(e))]
//~^ ERROR: must only be one word
pub fn foo5(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
input
}

View file

@ -11,15 +11,15 @@
// force-host
// no-prefer-dynamic
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive_a(input: TokenStream) -> TokenStream {
input
}

View file

@ -11,15 +11,15 @@
// force-host
// no-prefer-dynamic
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive_a(input: TokenStream) -> TokenStream {
input
}

View file

@ -11,15 +11,15 @@
// no-prefer-dynamic
// force-host
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive_a(_input: TokenStream) -> TokenStream {
"struct A { inner }".parse().unwrap()
}

View file

@ -11,15 +11,15 @@
// no-prefer-dynamic
// force-host
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive_a(_input: TokenStream) -> TokenStream {
panic!("nope!");
}

View file

@ -11,15 +11,15 @@
// force-host
// no-prefer-dynamic
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(Unstable)]
#[proc_macro_derive(Unstable)]
pub fn derive(_input: TokenStream) -> TokenStream {
"

View file

@ -11,15 +11,15 @@
// force-host
// no-prefer-dynamic
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(Unstable)]
#[proc_macro_derive(Unstable)]
pub fn derive(_input: TokenStream) -> TokenStream {
"unsafe fn foo() -> u32 { ::std::intrinsics::init() }".parse().unwrap()

View file

@ -11,6 +11,6 @@
// aux-build:derive-a.rs
extern crate derive_a;
//~^ ERROR: crates of the `rustc-macro` crate type cannot be linked at runtime
//~^ ERROR: crates of the `proc-macro` crate type cannot be linked at runtime
fn main() {}

View file

@ -10,19 +10,19 @@
// no-prefer-dynamic
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn foo(input: TokenStream) -> TokenStream {
input
}
#[rustc_macro_derive(A)] //~ ERROR: derive mode defined twice in this crate
#[proc_macro_derive(A)] //~ ERROR: derive mode defined twice in this crate
pub fn bar(input: TokenStream) -> TokenStream {
input
}

View file

@ -10,7 +10,7 @@
// aux-build:derive-bad.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate derive_bad;

View file

@ -10,7 +10,7 @@
// aux-build:derive-a.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#![allow(warnings)]
#[macro_use]

View file

@ -10,7 +10,7 @@
// aux-build:derive-unstable-2.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#![allow(warnings)]
#[macro_use]

View file

@ -10,7 +10,7 @@
// aux-build:derive-unstable.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#![allow(warnings)]
#[macro_use]

View file

@ -8,10 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: cannot export macro_rules! macros from a `rustc-macro` crate
// error-pattern: cannot export macro_rules! macros from a `proc-macro` crate
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#[macro_export]
macro_rules! foo {

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rustc-macro"]
#![crate_type = "proc-macro"]
#![allow(warnings)]
pub fn a() {} //~ ERROR: cannot export any items

View file

@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: the `rustc-macro` crate type is experimental
// error-pattern: the `proc-macro` crate type is experimental
#![crate_type = "rustc-macro"]
#![crate_type = "proc-macro"]

View file

@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate rustc_macro; //~ ERROR: use of unstable library feature
extern crate proc_macro; //~ ERROR: use of unstable library feature
fn main() {}

View file

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rustc-macro"]
#![crate_type = "proc-macro"]
#[rustc_macro_derive(Foo)] //~ ERROR: is an experimental feature
#[proc_macro_derive(Foo)] //~ ERROR: is an experimental feature
pub fn foo() {
}

View file

@ -8,5 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[cfg(rustc_macro)] //~ ERROR: experimental and subject to change
#[cfg(proc_macro)] //~ ERROR: experimental and subject to change
fn foo() {}

View file

@ -10,7 +10,7 @@
// aux-build:derive-a.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#![allow(warnings)]
#[macro_use]

View file

@ -10,7 +10,7 @@
// aux-build:derive-panic.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate derive_panic;

View file

@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_macro)]
#![feature(proc_macro)]
extern crate rustc_macro;
extern crate proc_macro;
#[rustc_macro_derive(Foo)]
//~^ ERROR: only usable with crates of the `rustc-macro` crate type
pub fn foo(a: rustc_macro::TokenStream) -> rustc_macro::TokenStream {
#[proc_macro_derive(Foo)]
//~^ ERROR: only usable with crates of the `proc-macro` crate type
pub fn foo(a: proc_macro::TokenStream) -> proc_macro::TokenStream {
a
}

View file

@ -8,14 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(PartialEq)]
#[proc_macro_derive(PartialEq)]
//~^ ERROR: cannot override a built-in #[derive] mode
pub fn foo(input: TokenStream) -> TokenStream {
input

View file

@ -11,7 +11,7 @@
// aux-build:derive-a.rs
// aux-build:derive-a-2.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate derive_a;

View file

@ -8,17 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![allow(warnings)]
extern crate rustc_macro;
extern crate proc_macro;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
unsafe extern fn foo(a: i32, b: u32) -> u32 {
//~^ ERROR: mismatched types
//~| NOTE: expected normal fn, found unsafe fn
//~| NOTE: expected type `fn(rustc_macro::TokenStream) -> rustc_macro::TokenStream`
//~| NOTE: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
//~| NOTE: found type `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
loop {}
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: cannot mix `rustc-macro` crate type with others
// error-pattern: cannot mix `proc-macro` crate type with others
#![crate_type = "rustc-macro"]
#![crate_type = "proc-macro"]
#![crate_type = "rlib"]

View file

@ -8,5 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: cannot mix `rustc-macro` crate type with others
// compile-flags: --crate-type rlib --crate-type rustc-macro
// error-pattern: cannot mix `proc-macro` crate type with others
// compile-flags: --crate-type rlib --crate-type proc-macro

View file

@ -1,46 +0,0 @@
// Copyright 2016 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.
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
extern crate rustc_macro;
#[rustc_macro_derive]
//~^ ERROR: attribute must be of form: #[rustc_macro_derive(TraitName)]
pub fn foo1(input: rustc_macro::TokenStream) -> rustc_macro::TokenStream {
input
}
#[rustc_macro_derive = "foo"]
//~^ ERROR: attribute must be of form: #[rustc_macro_derive(TraitName)]
pub fn foo2(input: rustc_macro::TokenStream) -> rustc_macro::TokenStream {
input
}
#[rustc_macro_derive(
a = "b"
)]
//~^^ ERROR: must only be one word
pub fn foo3(input: rustc_macro::TokenStream) -> rustc_macro::TokenStream {
input
}
#[rustc_macro_derive(b, c)]
//~^ ERROR: attribute must only have one argument
pub fn foo4(input: rustc_macro::TokenStream) -> rustc_macro::TokenStream {
input
}
#[rustc_macro_derive(d(e))]
//~^ ERROR: must only be one word
pub fn foo5(input: rustc_macro::TokenStream) -> rustc_macro::TokenStream {
input
}

View file

@ -3,4 +3,4 @@
all:
$(RUSTC) foo.rs
$(RUSTC) bar.rs --emit dep-info
grep "rustc-macro source" $(TMPDIR)/bar.d && exit 1 || exit 0
grep "proc-macro source" $(TMPDIR)/bar.d && exit 1 || exit 0

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate foo;

View file

@ -8,15 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive(input: TokenStream) -> TokenStream {
let input = input.to_string();
assert!(input.contains("struct A;"));

View file

@ -12,13 +12,13 @@
#![feature(plugin)]
#![feature(plugin_registrar)]
#![feature(rustc_private)]
#![plugin(proc_macro)]
#![plugin(proc_macro_plugin)]
extern crate rustc_plugin;
extern crate proc_macro;
extern crate proc_macro_plugin;
extern crate syntax;
use proc_macro::build::ident_eq;
use proc_macro_plugin::build::ident_eq;
use syntax::ext::base::{ExtCtxt, MacResult};
use syntax::ext::proc_macro_shim::build_block_emitter;

View file

@ -12,13 +12,13 @@
#![feature(plugin)]
#![feature(plugin_registrar)]
#![feature(rustc_private)]
#![plugin(proc_macro)]
#![plugin(proc_macro_plugin)]
extern crate rustc_plugin;
extern crate proc_macro;
extern crate proc_macro_plugin;
extern crate syntax;
use proc_macro::prelude::*;
use proc_macro_plugin::prelude::*;
use rustc_plugin::Registry;

View file

@ -12,14 +12,14 @@
#![feature(plugin)]
#![feature(plugin_registrar)]
#![feature(rustc_private)]
#![plugin(proc_macro)]
#![plugin(proc_macro_plugin)]
extern crate rustc_plugin;
extern crate proc_macro;
extern crate proc_macro_plugin;
extern crate syntax;
use syntax::ext::proc_macro_shim::prelude::*;
use proc_macro::prelude::*;
use proc_macro_plugin::prelude::*;
use rustc_plugin::Registry;

View file

@ -10,11 +10,11 @@
#![feature(plugin, plugin_registrar, rustc_private)]
extern crate proc_macro;
extern crate proc_macro_plugin;
extern crate rustc_plugin;
extern crate syntax;
use proc_macro::prelude::*;
use proc_macro_plugin::prelude::*;
use rustc_plugin::Registry;
use syntax::ext::base::SyntaxExtension;
use syntax::ext::proc_macro_shim::prelude::*;

View file

@ -12,10 +12,10 @@
#![feature(plugin)]
#![feature(rustc_private)]
#![plugin(proc_macro)]
#![plugin(proc_macro_plugin)]
extern crate proc_macro;
use proc_macro::prelude::*;
extern crate proc_macro_plugin;
use proc_macro_plugin::prelude::*;
extern crate syntax;
use syntax::ast::Ident;

View file

@ -10,7 +10,7 @@
// aux-build:add-impl.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate add_impl;

View file

@ -10,7 +10,7 @@
// aux-build:append-impl.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#![allow(warnings)]
#[macro_use]

View file

@ -10,16 +10,16 @@
// no-prefer-dynamic
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(AddImpl)]
// #[cfg(rustc_macro)]
#[proc_macro_derive(AddImpl)]
// #[cfg(proc_macro)]
pub fn derive(input: TokenStream) -> TokenStream {
(input.to_string() + "
impl B {

View file

@ -11,15 +11,15 @@
// force-host
// no-prefer-dynamic
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(Append)]
#[proc_macro_derive(Append)]
pub fn derive_a(input: TokenStream) -> TokenStream {
let mut input = input.to_string();
input.push_str("

View file

@ -10,15 +10,15 @@
// no-prefer-dynamic
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive(input: TokenStream) -> TokenStream {
let input = input.to_string();
assert!(input.contains("struct A;"));

View file

@ -10,15 +10,15 @@
// no-prefer-dynamic
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(AToB)]
#[proc_macro_derive(AToB)]
pub fn derive(input: TokenStream) -> TokenStream {
let input = input.to_string();
assert_eq!(input, "struct A;\n");

View file

@ -10,15 +10,15 @@
// no-prefer-dynamic
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(CToD)]
#[proc_macro_derive(CToD)]
pub fn derive(input: TokenStream) -> TokenStream {
let input = input.to_string();
assert_eq!(input, "struct C;\n");

View file

@ -9,23 +9,23 @@
// except according to those terms.
// no-prefer-dynamic
// compile-flags:--crate-type rustc-macro
// compile-flags:--crate-type proc-macro
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(AToB)]
#[proc_macro_derive(AToB)]
pub fn derive1(input: TokenStream) -> TokenStream {
println!("input1: {:?}", input.to_string());
assert_eq!(input.to_string(), "#[derive(BToC)]\nstruct A;\n");
"#[derive(BToC)] struct B;".parse().unwrap()
}
#[rustc_macro_derive(BToC)]
#[proc_macro_derive(BToC)]
pub fn derive2(input: TokenStream) -> TokenStream {
assert_eq!(input.to_string(), "struct B;\n");
"struct C;".parse().unwrap()

View file

@ -10,16 +10,16 @@
// no-prefer-dynamic
#![crate_type = "rustc-macro"]
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "proc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![deny(warnings)]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(A)]
#[proc_macro_derive(A)]
pub fn derive(input: TokenStream) -> TokenStream {
let input = input.to_string();
assert!(input.contains("struct A;"));

View file

@ -10,7 +10,7 @@
// aux-build:derive-same-struct.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate derive_same_struct;

View file

@ -11,7 +11,7 @@
// aux-build:expand-with-a-macro.rs
// ignore-stage1
#![feature(rustc_macro)]
#![feature(proc_macro)]
#![deny(warnings)]
#[macro_use]

View file

@ -11,7 +11,7 @@
// aux-build:derive-atob.rs
// aux-build:derive-ctod.rs
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate derive_atob;

View file

@ -11,7 +11,7 @@
// aux-build:derive-a.rs
// ignore-stage1
#![feature(rustc_macro)]
#![feature(proc_macro)]
#[macro_use]
extern crate derive_a;

View file

@ -10,15 +10,15 @@
// no-prefer-dynamic
#![feature(rustc_macro)]
#![feature(rustc_macro_lib)]
#![crate_type = "rustc-macro"]
#![feature(proc_macro)]
#![feature(proc_macro_lib)]
#![crate_type = "proc-macro"]
extern crate rustc_macro;
extern crate proc_macro;
use rustc_macro::TokenStream;
use proc_macro::TokenStream;
#[rustc_macro_derive(Foo)]
#[proc_macro_derive(Foo)]
pub fn foo(input: TokenStream) -> TokenStream {
input
}