Open
Description
crate: custom_attr
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn custom(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}
crate: not the previous one
extern crate custom_attr;
use custom_attr::custom;
fn main() {
match () {
#[custom]
() => {}
}
}
Current Error
error[E0658]: The attribute `custom` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
--> src/main.rs:LL:L
|
L | #[custom]
| ^^^^^^^^
|
= help: add #![feature(custom_attribute)] to the crate attributes to enable
Wanted Error
error[E0NNN]: Custom attributes can only be applied to items
--> src/main.rs:LL:L
|
L | #[custom]
| ^^^^^^^^
|
(I'm assuming they can only be applied to items in nightly without using feature flags in Rust today. It'd be nice to get that assumption confirmed as well)