Update uses of rustfmt_skip
to rustfmt::skip
This commit is contained in:
parent
de950c2973
commit
51f566062f
29 changed files with 55 additions and 58 deletions
|
@ -1951,7 +1951,7 @@ lines are found, they are trimmed down to match this integer.
|
||||||
Original Code:
|
Original Code:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![rustfmt_skip]
|
#![rustfmt::skip]
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
println!("a");
|
println!("a");
|
||||||
|
@ -2010,7 +2010,7 @@ them, additional blank lines are inserted.
|
||||||
Original Code (rustfmt will not change it with the default value of `0`):
|
Original Code (rustfmt will not change it with the default value of `0`):
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![rustfmt_skip]
|
#![rustfmt::skip]
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
println!("a");
|
println!("a");
|
||||||
|
|
|
@ -1253,7 +1253,7 @@ mod test {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[rustfmt::skip]
|
||||||
fn format_comments() {
|
fn format_comments() {
|
||||||
let mut config: ::config::Config = Default::default();
|
let mut config: ::config::Config = Default::default();
|
||||||
config.set().wrap_comments(true);
|
config.set().wrap_comments(true);
|
||||||
|
|
|
@ -8,12 +8,9 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(custom_attribute)]
|
#![feature(tool_attributes)]
|
||||||
#![feature(decl_macro)]
|
#![feature(decl_macro)]
|
||||||
// FIXME(cramertj) remove after match_default_bindings merges
|
|
||||||
#![allow(stable_features)]
|
|
||||||
#![allow(unused_attributes)]
|
#![allow(unused_attributes)]
|
||||||
#![feature(match_default_bindings)]
|
|
||||||
#![feature(type_ascription)]
|
#![feature(type_ascription)]
|
||||||
#![feature(unicode_internals)]
|
#![feature(unicode_internals)]
|
||||||
|
|
||||||
|
@ -396,7 +393,7 @@ where
|
||||||
Ok((result, has_diff))
|
Ok((result, has_diff))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the line with the given line number was skipped by `#[rustfmt_skip]`.
|
/// Returns true if the line with the given line number was skipped by `#[rustfmt::skip]`.
|
||||||
fn is_skipped_line(line_number: usize, skipped_range: &[(usize, usize)]) -> bool {
|
fn is_skipped_line(line_number: usize, skipped_range: &[(usize, usize)]) -> bool {
|
||||||
skipped_range
|
skipped_range
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -975,7 +972,7 @@ mod unit_tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_format_code_block_fail() {
|
fn test_format_code_block_fail() {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
let code_block = "this_line_is_100_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(x, y, z);";
|
let code_block = "this_line_is_100_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(x, y, z);";
|
||||||
assert!(format_code_block(code_block, &Config::default()).is_none());
|
assert!(format_code_block(code_block, &Config::default()).is_none());
|
||||||
}
|
}
|
||||||
|
|
|
@ -704,14 +704,14 @@ impl ConfigCodeBlock {
|
||||||
// We never expect to not have a code block.
|
// We never expect to not have a code block.
|
||||||
assert!(self.code_block.is_some() && self.code_block_start.is_some());
|
assert!(self.code_block.is_some() && self.code_block_start.is_some());
|
||||||
|
|
||||||
// See if code block begins with #![rustfmt_skip].
|
// See if code block begins with #![rustfmt::skip].
|
||||||
let fmt_skip = self
|
let fmt_skip = self
|
||||||
.code_block
|
.code_block
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.nth(0)
|
.nth(0)
|
||||||
.unwrap_or("") == "#![rustfmt_skip]";
|
.unwrap_or("") == "#![rustfmt::skip]";
|
||||||
|
|
||||||
if self.config_name.is_none() && !fmt_skip {
|
if self.config_name.is_none() && !fmt_skip {
|
||||||
write_message(&format!(
|
write_message(&format!(
|
||||||
|
@ -790,7 +790,7 @@ impl ConfigCodeBlock {
|
||||||
// - Rust code blocks are identifed by lines beginning with "```rust".
|
// - Rust code blocks are identifed by lines beginning with "```rust".
|
||||||
// - One explicit configuration setting is supported per code block.
|
// - One explicit configuration setting is supported per code block.
|
||||||
// - Rust code blocks with no configuration setting are illegal and cause an
|
// - Rust code blocks with no configuration setting are illegal and cause an
|
||||||
// assertion failure, unless the snippet begins with #![rustfmt_skip].
|
// assertion failure, unless the snippet begins with #![rustfmt::skip].
|
||||||
// - Configuration names in Configurations.md must be in the form of
|
// - Configuration names in Configurations.md must be in the form of
|
||||||
// "## `NAME`".
|
// "## `NAME`".
|
||||||
// - Configuration values in Configurations.md must be in the form of
|
// - Configuration values in Configurations.md must be in the form of
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
skip_children = true
|
skip_children = true
|
||||||
|
|
|
@ -48,5 +48,5 @@ fn debug_function() {
|
||||||
|
|
||||||
#[link_section=".vectors"]
|
#[link_section=".vectors"]
|
||||||
#[no_mangle] // Test this attribute is preserved.
|
#[no_mangle] // Test this attribute is preserved.
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
pub static ISSUE_1284: [i32; 16] = [];
|
pub static ISSUE_1284: [i32; 16] = [];
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn main() {
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub struct Foo {
|
pub struct Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -166,7 +166,7 @@ struct Palette { /// A map of indices in the palette to a count of pixels in app
|
||||||
// when the field had attributes
|
// when the field had attributes
|
||||||
struct FieldsWithAttributes {
|
struct FieldsWithAttributes {
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
#[rustfmt::skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
||||||
//Another pre comment
|
//Another pre comment
|
||||||
#[attr1]
|
#[attr1]
|
||||||
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
||||||
|
|
|
@ -13,7 +13,7 @@ fn main() {
|
||||||
y: y,
|
y: y,
|
||||||
#[attr]
|
#[attr]
|
||||||
z: z,
|
z: z,
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
skipped: skipped,
|
skipped: skipped,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ fn main() {
|
||||||
y: y,
|
y: y,
|
||||||
#[attr]
|
#[attr]
|
||||||
z: z,
|
z: z,
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
skipped: skipped,
|
skipped: skipped,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ pub enum EnumWithAttributes {
|
||||||
//This is a pre comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
//This is a pre comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
TupleVar(usize, usize, usize), // AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
TupleVar(usize, usize, usize), // AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
SkippedItem(String,String,), // Post-comment
|
SkippedItem(String,String,), // Post-comment
|
||||||
#[another_attr]
|
#[another_attr]
|
||||||
#[attr2]
|
#[attr2]
|
||||||
|
|
|
@ -13,4 +13,4 @@ use y;
|
||||||
|
|
||||||
|
|
||||||
use x;
|
use x;
|
||||||
use a;
|
use a;
|
||||||
|
|
|
@ -48,7 +48,7 @@ fn foo() {
|
||||||
#[an_attribute]
|
#[an_attribute]
|
||||||
// Comment after an attribute.
|
// Comment after an attribute.
|
||||||
None => 0,
|
None => 0,
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
Blurb => { }
|
Blurb => { }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ fn matches() {
|
||||||
|
|
||||||
fn match_skip() {
|
fn match_skip() {
|
||||||
let _ = match Some(1) {
|
let _ = match Some(1) {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
Some( n ) => n,
|
Some( n ) => n,
|
||||||
None => 1,
|
None => 1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn baz<'a: 'b /* comment on 'a */, T: Somsssssssssssssssssssssssssssssssssssssss
|
||||||
#[attr2]#[attr3]extern crate foo;
|
#[attr2]#[attr3]extern crate foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
fn qux(a: dadsfa, // Comment 1
|
fn qux(a: dadsfa, // Comment 1
|
||||||
b: sdfasdfa, // Comment 2
|
b: sdfasdfa, // Comment 2
|
||||||
c: dsfdsafa) // Comment 3
|
c: dsfdsafa) // Comment 3
|
||||||
|
@ -78,7 +78,7 @@ pub trait GraphWalk<'a, N, E> {
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub struct Foo {
|
pub struct Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -126,7 +126,7 @@ fn deconstruct(foo: Bar) -> (SocketAddr, Method, Headers,
|
||||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
mod a{
|
mod a{
|
||||||
fn foo(x: T) {
|
fn foo(x: T) {
|
||||||
let x: T = dfasdf;
|
let x: T = dfasdf;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub struct Foo {
|
pub struct Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -139,7 +139,7 @@ struct Palette { /// A map of indices in the palette to a count of pixels in app
|
||||||
// when the field had attributes
|
// when the field had attributes
|
||||||
struct FieldsWithAttributes {
|
struct FieldsWithAttributes {
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
#[rustfmt::skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
||||||
//Another pre comment
|
//Another pre comment
|
||||||
#[attr1]
|
#[attr1]
|
||||||
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
||||||
|
|
|
@ -89,7 +89,7 @@ trait AAAAAAAAAAAAAAAAAAA = BBBBBBBBBBBBBBBBBBB + CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
||||||
trait AAAAAAAAAAAAAAAAAA = BBBBBBBBBBBBBBBBBBB + CCCCCCCCCCCCCCCCCCCCCCCCCCCCC + DDDDDDDDDDDDDDDDDDD;
|
trait AAAAAAAAAAAAAAAAAA = BBBBBBBBBBBBBBBBBBB + CCCCCCCCCCCCCCCCCCCCCCCCCCCCC + DDDDDDDDDDDDDDDDDDD;
|
||||||
trait AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<A, B, C, D, E> = FooBar;
|
trait AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<A, B, C, D, E> = FooBar;
|
||||||
trait AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<A, B, C, D, E> = FooBar;
|
trait AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<A, B, C, D, E> = FooBar;
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
trait FooBar = Foo
|
trait FooBar = Foo
|
||||||
+ Bar;
|
+ Bar;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub union Foo {
|
pub union Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -100,7 +100,7 @@ union Palette { /// A map of indices in the palette to a count of pixels in appr
|
||||||
// when the field had attributes
|
// when the field had attributes
|
||||||
union FieldsWithAttributes {
|
union FieldsWithAttributes {
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
#[rustfmt::skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
||||||
//Another pre comment
|
//Another pre comment
|
||||||
#[attr1]
|
#[attr1]
|
||||||
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
||||||
|
|
|
@ -47,5 +47,5 @@ fn debug_function() {
|
||||||
|
|
||||||
#[link_section=".vectors"]
|
#[link_section=".vectors"]
|
||||||
#[no_mangle] // Test this attribute is preserved.
|
#[no_mangle] // Test this attribute is preserved.
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
pub static ISSUE_1284: [i32; 16] = [];
|
pub static ISSUE_1284: [i32; 16] = [];
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn main() {
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub struct Foo {
|
pub struct Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -171,8 +171,8 @@ struct Palette {
|
||||||
// when the field had attributes
|
// when the field had attributes
|
||||||
struct FieldsWithAttributes {
|
struct FieldsWithAttributes {
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
|
#[rustfmt::skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
|
||||||
* BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
|
* BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
|
||||||
// Another pre comment
|
// Another pre comment
|
||||||
#[attr1]
|
#[attr1]
|
||||||
#[attr2]
|
#[attr2]
|
||||||
|
|
|
@ -9,7 +9,7 @@ fn main() {
|
||||||
y: y,
|
y: y,
|
||||||
#[attr]
|
#[attr]
|
||||||
z: z,
|
z: z,
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
skipped: skipped,
|
skipped: skipped,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ fn main() {
|
||||||
y,
|
y,
|
||||||
#[attr]
|
#[attr]
|
||||||
z,
|
z,
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
skipped: skipped,
|
skipped: skipped,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ pub enum EnumWithAttributes {
|
||||||
TupleVar(usize, usize, usize), /* AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA
|
TupleVar(usize, usize, usize), /* AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
|
* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
SkippedItem(String,String,), // Post-comment
|
SkippedItem(String,String,), // Post-comment
|
||||||
#[another_attr]
|
#[another_attr]
|
||||||
#[attr2]
|
#[attr2]
|
||||||
|
|
|
@ -92,7 +92,7 @@ fn inner() {
|
||||||
x
|
x
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
fn foo(a: i32) -> i32 {
|
fn foo(a: i32) -> i32 {
|
||||||
// comment
|
// comment
|
||||||
if a > 0 { 1 } else { 2 }
|
if a > 0 { 1 } else { 2 }
|
||||||
|
|
|
@ -51,7 +51,7 @@ fn foo() {
|
||||||
#[an_attribute]
|
#[an_attribute]
|
||||||
// Comment after an attribute.
|
// Comment after an attribute.
|
||||||
None => 0,
|
None => 0,
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
Blurb => { }
|
Blurb => { }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ fn matches() {
|
||||||
|
|
||||||
fn match_skip() {
|
fn match_skip() {
|
||||||
let _ = match Some(1) {
|
let _ = match Some(1) {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
Some( n ) => n,
|
Some( n ) => n,
|
||||||
None => 1,
|
None => 1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,7 +58,7 @@ fn baz<
|
||||||
extern crate foo;
|
extern crate foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
fn qux(a: dadsfa, // Comment 1
|
fn qux(a: dadsfa, // Comment 1
|
||||||
b: sdfasdfa, // Comment 2
|
b: sdfasdfa, // Comment 2
|
||||||
c: dsfdsafa) // Comment 3
|
c: dsfdsafa) // Comment 3
|
||||||
|
@ -103,7 +103,7 @@ pub trait GraphWalk<'a, N, E> {
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub struct Foo {
|
pub struct Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -172,7 +172,7 @@ fn deconstruct(
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
mod a{
|
mod a{
|
||||||
fn foo(x: T) {
|
fn foo(x: T) {
|
||||||
let x: T = dfasdf;
|
let x: T = dfasdf;
|
||||||
|
|
|
@ -12,13 +12,13 @@ fn foo(
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LateLintPass for UsedUnderscoreBinding {
|
impl LateLintPass for UsedUnderscoreBinding {
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
fn check_expr() { // comment
|
fn check_expr() { // comment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn issue1346() {
|
fn issue1346() {
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
Box::new(self.inner.call(req).then(move |result| {
|
Box::new(self.inner.call(req).then(move |result| {
|
||||||
match result {
|
match result {
|
||||||
Ok(resp) => Box::new(future::done(Ok(resp))),
|
Ok(resp) => Box::new(future::done(Ok(resp))),
|
||||||
|
@ -46,7 +46,7 @@ fn skip_on_statements() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Semi
|
// Semi
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
foo(
|
foo(
|
||||||
1, 2, 3, 4,
|
1, 2, 3, 4,
|
||||||
1, 2,
|
1, 2,
|
||||||
|
@ -54,15 +54,15 @@ fn skip_on_statements() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Local
|
// Local
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
let x = foo( a, b , c);
|
let x = foo( a, b , c);
|
||||||
|
|
||||||
// Item
|
// Item
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
use foobar;
|
use foobar;
|
||||||
|
|
||||||
// Mac
|
// Mac
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
vec![
|
vec![
|
||||||
1, 2, 3, 4,
|
1, 2, 3, 4,
|
||||||
1, 2, 3, 4,
|
1, 2, 3, 4,
|
||||||
|
@ -74,7 +74,7 @@ fn skip_on_statements() {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Expr
|
// Expr
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
foo( a, b , c)
|
foo( a, b , c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#![rustfmt_skip]
|
#![rustfmt::skip]
|
||||||
use a :: b
|
use a :: b
|
||||||
;
|
;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub struct Foo {
|
pub struct Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -144,8 +144,8 @@ struct Palette {
|
||||||
// when the field had attributes
|
// when the field had attributes
|
||||||
struct FieldsWithAttributes {
|
struct FieldsWithAttributes {
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
|
#[rustfmt::skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
|
||||||
* BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
|
* BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
|
||||||
// Another pre comment
|
// Another pre comment
|
||||||
#[attr1]
|
#[attr1]
|
||||||
#[attr2]
|
#[attr2]
|
||||||
|
|
|
@ -127,7 +127,7 @@ trait AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
D,
|
D,
|
||||||
E,
|
E,
|
||||||
> = FooBar;
|
> = FooBar;
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
trait FooBar = Foo
|
trait FooBar = Foo
|
||||||
+ Bar;
|
+ Bar;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/// A Doc comment
|
/// A Doc comment
|
||||||
#[AnAttribute]
|
#[AnAttribute]
|
||||||
pub union Foo {
|
pub union Foo {
|
||||||
#[rustfmt_skip]
|
#[rustfmt::skip]
|
||||||
f : SomeType, // Comment beside a field
|
f : SomeType, // Comment beside a field
|
||||||
f: SomeType, // Comment beside a field
|
f: SomeType, // Comment beside a field
|
||||||
// Comment on a field
|
// Comment on a field
|
||||||
|
@ -100,8 +100,8 @@ union Palette {
|
||||||
// when the field had attributes
|
// when the field had attributes
|
||||||
union FieldsWithAttributes {
|
union FieldsWithAttributes {
|
||||||
// Pre Comment
|
// Pre Comment
|
||||||
#[rustfmt_skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
|
#[rustfmt::skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
|
||||||
* BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
|
* BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
|
||||||
// Another pre comment
|
// Another pre comment
|
||||||
#[attr1]
|
#[attr1]
|
||||||
#[attr2]
|
#[attr2]
|
||||||
|
|
Loading…
Reference in a new issue