X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Ftarget%2Fmultiple.rs;h=0c330d80a56444b683bce86b34b96faae6744268;hb=4f522794ae0c536768908a4dd3e8292ada2c70a0;hp=7b371409fba96c33557ba633d6bb99d808f1c8b7;hpb=3533f72c458d5772a47c9efda761edef396a9f0f;p=rust.git diff --git a/tests/target/multiple.rs b/tests/target/multiple.rs index 7b371409fba..0c330d80a56 100644 --- a/tests/target/multiple.rs +++ b/tests/target/multiple.rs @@ -1,8 +1,9 @@ +// rustfmt-normalize_comments: true // rustfmt-wrap_comments: true +// rustfmt-format_strings: true // Test of lots of random stuff. // FIXME split this into multiple, self-contained tests. - #[attr1] extern crate foo; #[attr2] @@ -15,32 +16,34 @@ extern crate foo; use std::cell::*; -use std::{self, any, ascii, borrow, boxed, char, borrow, boxed, char, borrow, borrow, boxed, char, - borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, - borrow, boxed, char, borrow, boxed, char, borrow, boxed, char}; +use std::{self, any, ascii, borrow, borrow, borrow, borrow, borrow, borrow, borrow, borrow, + borrow, borrow, borrow, boxed, boxed, boxed, boxed, boxed, boxed, boxed, boxed, boxed, + boxed, char, char, char, char, char, char, char, char, char, char}; mod doc; mod other; - // sfdgfffffffffffffffffffffffffffffffffffffffffffffffffffffff // ffffffffffffffffffffffffffffffffffffffffff fn foo(a: isize, b: u32 /* blah blah */, c: f64) {} fn foo() -> Box - where 'a: 'b, - for<'a> D<'b>: 'a +where + 'a: 'b, + for<'a> D<'b>: 'a, { hello!() } -fn baz<'a: 'b, // comment on 'a - T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType /* comment on T */> - (a: A, - b: B, // comment on b - c: C) - -> Bob { +fn baz< + 'a: 'b, // comment on 'a + T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType, // comment on T +>( + a: A, + b: B, // comment on b + c: C, +) -> Bob { #[attr1] extern crate foo; #[attr2] @@ -63,10 +66,11 @@ fn qux(a: dadsfa, // Comment 1 /// Blah blah blah. impl Bar { - fn foo(&mut self, - a: sdfsdfcccccccccccccccccccccccccccccccccccccccccccccccccc, // comment on a - b: sdfasdfsdfasfs /* closing comment */) - -> isize { + fn foo( + &mut self, + a: sdfsdfcccccccccccccccccccccccccccccccccccccccccccccccccc, // comment on a + b: sdfasdfsdfasfs, // closing comment + ) -> isize { } /// Blah blah blah. @@ -110,7 +114,8 @@ pub struct Foo { // With a where clause and generics. pub struct Foo<'a, Y: Baz> - where X: Whatever +where + X: Whatever, { f: SomeType, // Comment beside a field } @@ -122,17 +127,20 @@ fn main() { println!("{}", i); } - while true { hello(); } - let rc = Cell::new(42usize, - 42usize, - Cell::new(42usize, - remaining_widthremaining_widthremaining_widthremaining_width), - 42usize); - let rc = RefCell::new(42usize, remaining_width, remaining_width); // a comment + let rc = Cell::new( + 42usize, + 42usize, + Cell::new( + 42usize, + remaining_widthremaining_widthremaining_widthremaining_width, + ), + 42usize, + ); + let rc = RefCell::new(42usize, remaining_width, remaining_width); // a comment let x = "Hello!!!!!!!!! abcd abcd abcd abcd abcd abcd\n abcd abcd abcd abcd abcd abcd abcd \ abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \ abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \ @@ -140,21 +148,31 @@ fn main() { let s = expand(a, b); } -fn deconstruct() - -> (SocketAddr, - Method, - Headers, - RequestUri, - HttpVersion, - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) -{ +fn deconstruct() -> ( + SocketAddr, + Method, + Headers, + RequestUri, + HttpVersion, + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, +) { } -fn deconstruct(foo: Bar) - -> (SocketAddr, - Method, - Headers, - RequestUri, - HttpVersion, - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) { +fn deconstruct( + foo: Bar, +) -> ( + SocketAddr, + Method, + Headers, + RequestUri, + HttpVersion, + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, +) { +} + +#[rustfmt_skip] +mod a{ +fn foo(x: T) { + let x: T = dfasdf; +} }