Document #![register_tool]

This commit is contained in:
jyn 2025-03-16 22:27:09 -04:00
parent 0998d4095b
commit 10bc5acf0d
5 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,5 @@
//@ check-pass
//@ compile-flags: -Z crate-attr=feature(register_tool) -Z crate-attr=register_tool(foo)
#[allow(foo::bar)]
fn main() {}

View file

@ -0,0 +1,7 @@
//@ check-pass
#![feature(register_tool)]
#![register_tool(foo, bar, baz)]
#[allow(foo::a, bar::b, baz::c)]
fn main() {}

View file

@ -0,0 +1,4 @@
#![feature(register_tool)]
#![register_tool(foo::bar)] //~ ERROR only accepts identifiers
fn main() {}

View file

@ -0,0 +1,8 @@
error: `register_tool` only accepts identifiers
--> $DIR/nested-disallowed.rs:2:18
|
LL | #![register_tool(foo::bar)]
| ^^^^^^^^ not an identifier
error: aborting due to 1 previous error