]> git.lizzy.rs Git - rust.git/blob - tests/target/trait.rs
Merge pull request #681 from rust-lang-nursery/comment-style
[rust.git] / tests / target / trait.rs
1 // Test traits
2
3 trait Foo {
4     fn bar(x: i32) -> Baz<U> {
5         Baz::new()
6     }
7
8     fn baz(a: AAAAAAAAAAAAAAAAAAAAAA, b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) -> RetType;
9
10     fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Another comment
11            b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
12            -> RetType; // Some comment
13
14     fn baz(&mut self) -> i32;
15
16     fn increment(&mut self, x: i32);
17
18     fn read(&mut self, x: BufReader<R> /* Used to be MemReader */) where R: Read;
19 }
20
21 pub trait WriteMessage {
22     fn write_message(&mut self, &FrontendMessage) -> io::Result<()>;
23 }
24
25 trait Runnable {
26     fn handler(self: &Runnable);
27 }
28
29 trait TraitWithExpr {
30     fn fn_with_expr(x: [i32; 1]);
31 }
32
33 trait Test {
34     fn read_struct<T, F>(&mut self, s_name: &str, len: usize, f: F) -> Result<T, Self::Error>
35         where F: FnOnce(&mut Self) -> Result<T, Self::Error>;
36 }