X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftarget%2Ffn.rs;h=66a6e9082de2ffea1ea3f41775792cc40afe60ca;hb=51f566062fefc2262dd3b56f7e385f1dd749bd8b;hp=b78f6d9ffc33e4e0325c5e08349d966fa4bdafbf;hpb=98c9c6e9ef758e3ec27131d7d35114135453fbef;p=rust.git diff --git a/tests/target/fn.rs b/tests/target/fn.rs index b78f6d9ffc3..66a6e9082de 100644 --- a/tests/target/fn.rs +++ b/tests/target/fn.rs @@ -1,60 +1,64 @@ // Tests different fns -fn foo(a: AAAA, b: BBB, c: CCC) -> RetType { +fn foo(a: AAAA, b: BBB, c: CCC) -> RetType {} -} - -fn foo(a: AAAA, b: BBB, c: CCC) -> RetType - where T: Blah +fn foo(a: AAAA, b: BBB /* some, weird, inline comment */, c: CCC) -> RetType +where + T: Blah, { - } -fn foo(a: AAA) - where T: Blah +fn foo(a: AAA /* (comment) */) +where + T: Blah, { - } -fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, - b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) - -> RetType - where T: Blah +fn foo( + a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, + b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB, +) -> RetType +where + T: Blah, { } - -fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, - b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) - -> RetType - where T: Blah, - U: dsfasdfasdfasd +fn foo( + a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, + b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB, +) -> RetType +where + T: Blah, + U: dsfasdfasdfasd, { } +fn foo B /* paren inside generics */>() {} + impl Foo { fn with_no_errors(&mut self, f: F) -> T - where F: FnOnce(&mut Resolver) -> T + where + F: FnOnce(&mut Resolver) -> T, { } - fn foo(mut self, mut bar: u32) { - } + fn foo(mut self, mut bar: u32) {} - fn bar(self, mut bazz: u32) { - } + fn bar(self, mut bazz: u32) {} } -pub fn render<'a, - N: Clone + 'a, - E: Clone + 'a, - G: Labeller<'a, N, E> + GraphWalk<'a, N, E>, - W: Write> - (g: &'a G, - w: &mut W) - -> io::Result<()> { +pub fn render< + 'a, + N: Clone + 'a, + E: Clone + 'a, + G: Labeller<'a, N, E> + GraphWalk<'a, N, E>, + W: Write, +>( + g: &'a G, + w: &mut W, +) -> io::Result<()> { render_opts(g, w, &[]) } @@ -72,7 +76,47 @@ const fn foo() { } } +fn homura>(_: T) {} + +fn issue377() -> (Box, Box) {} + fn main() { let _ = function(move || 5); let _ = move || 42; + let _ = || unsafe { abort() }; +} + +// With inner attributes. +fn inner() { + #![inline] + x +} + +#[cfg_attr(rustfmt, rustfmt::skip)] +fn foo(a: i32) -> i32 { + // comment + if a > 0 { 1 } else { 2 } +} + +fn ______________________baz( + a: i32, +) -> *mut ::std::option::Option< + extern "C" fn(arg1: i32, _____________________a: i32, arg3: i32) -> (), +> { +} + +pub fn check_path<'a, 'tcx>( + tcx: TyCtxt<'a, 'tcx, 'tcx>, + path: &hir::Path, + id: ast::NodeId, + cb: &mut FnMut(DefId, Span, &Option<&Stability>, &Option), +) { +} + +pub fn check_path<'a, 'tcx>( + tcx: TyCtxt<'a, 'tcx, 'tcx>, + path: &hir::Path, + id: ast::NodeId, + cb: &mut FnMut(DefId, Span, &Option<&Stability>, &Option), +) { }