-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.Category: This is a bug.
Description
Given this procedural macro:
#![feature(proc_macro)]
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn foo(attr: TokenStream, item: TokenStream) -> TokenStream {
println!("attr: {}", attr);
println!("item: {}", item);
item
}
and this crate:
#![feature(proc_macro)]
extern crate foo;
use foo::foo;
trait Trait {
#[foo]
fn trait_function(&self);
#[foo]
fn trait_function_default(&self) {}
}
fn main() {}
Building:
$ cargo +nightly build
Compiling foo v0.1.0 (file:///home/alex/code/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.73 secs
I saw no output :(
I find that #[foo]
is resolved, it just doesn't seem to get expanded!
Metadata
Metadata
Assignees
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.Category: This is a bug.