Document #![register_tool]
This commit is contained in:
parent
0998d4095b
commit
10bc5acf0d
5 changed files with 79 additions and 0 deletions
5
tests/ui/tool-attributes/crate-attr.rs
Normal file
5
tests/ui/tool-attributes/crate-attr.rs
Normal 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() {}
|
||||
7
tests/ui/tool-attributes/multiple-registered.rs
Normal file
7
tests/ui/tool-attributes/multiple-registered.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(register_tool)]
|
||||
#![register_tool(foo, bar, baz)]
|
||||
|
||||
#[allow(foo::a, bar::b, baz::c)]
|
||||
fn main() {}
|
||||
4
tests/ui/tool-attributes/nested-disallowed.rs
Normal file
4
tests/ui/tool-attributes/nested-disallowed.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#![feature(register_tool)]
|
||||
#![register_tool(foo::bar)] //~ ERROR only accepts identifiers
|
||||
|
||||
fn main() {}
|
||||
8
tests/ui/tool-attributes/nested-disallowed.stderr
Normal file
8
tests/ui/tool-attributes/nested-disallowed.stderr
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue