mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 05:56:56 +00:00
Ignore #[cfg_attr(rustfmt, rustfmt_skip)] functions
This adds to #[rustfmt_skip] but is usable on stable Rust!
This commit is contained in:
parent
26958a1c10
commit
e6b7ad3e39
@ -75,6 +75,9 @@ pub fn last_line_width(s: &str) -> usize {
|
||||
fn is_skip(meta_item: &MetaItem) -> bool {
|
||||
match meta_item.node {
|
||||
MetaItem_::MetaWord(ref s) => *s == SKIP_ANNOTATION,
|
||||
MetaItem_::MetaList(ref s, ref l) => {
|
||||
*s == "cfg_attr" && l.len() == 2 && is_skip(&l[1])
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user