-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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)
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.