Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tool_attributes feature to unstable book
- Loading branch information
1 parent
6c28f84
commit 8ad2d21
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/doc/unstable-book/src/language-features/tool-attributes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# `tool_attributes` | ||
|
||
The tracking issue for this feature is: [#44690] | ||
|
||
[#44690]: https://github.com/rust-lang/rust/issues/44690 | ||
|
||
------------------------ | ||
|
||
Tool attributes let you use scoped attributes to control the behavior | ||
of certain tools. | ||
|
||
Currently tool names which can be appear in scoped attributes are restricted to | ||
`clippy` and `rustfmt`. | ||
|
||
## An example | ||
|
||
```rust | ||
#![feature(tool_attributes)] | ||
|
||
#[rustfmt::skip] | ||
fn foo() { println!("hello, world"); } | ||
|
||
fn main() { | ||
foo(); | ||
} | ||
``` |