From be9e7dc68963db304533f3885ea6d27fddc81ae6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 21 Oct 2015 13:21:14 -0700 Subject: Don't use `visit::walk_*`. Instead, recurse by hand. This is much more straightforward to understand given how rustfmt rewriting works, and it avoids walking into expressions in unexpected places. Fixes #513. Fixes #514. --- tests/source/trait.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/source/trait.rs (limited to 'tests/source') diff --git a/tests/source/trait.rs b/tests/source/trait.rs new file mode 100644 index 00000000000..e04c7182421 --- /dev/null +++ b/tests/source/trait.rs @@ -0,0 +1,33 @@ +// Test traits + +trait Foo { + fn bar(x: i32 ) -> Baz< U> { Baz::new() + } + + fn baz(a: AAAAAAAAAAAAAAAAAAAAAA, +b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) +-> RetType; + + fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Another comment +b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) + -> RetType ; // Some comment + + fn baz(&mut self ) -> i32 ; + +fn increment(& mut self, x: i32 ); + + fn read(&mut self, x: BufReader /* Used to be MemReader */) + where R: Read; +} + +pub trait WriteMessage { + fn write_message (&mut self, &FrontendMessage) -> io::Result<()>; +} + +trait Runnable { + fn handler(self: & Runnable ); +} + +trait TraitWithExpr { + fn fn_with_expr(x: [i32; 1]); +} -- cgit 1.4.1-3-g733a5