]> git.lizzy.rs Git - rust.git/blob - tests/target/trait.rs
Add visual indent tests for chains
[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 }
37
38 trait T {}
39
40 trait Foo {
41     type Bar: Baz;
42 }
43
44 trait ConstCheck<T>: Foo
45     where T: Baz
46 {
47     const J: i32;
48 }
49
50 trait Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttt<T> where T: Foo {}
51
52 trait Ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt<T>
53     where T: Foo
54 {
55 }
56
57 trait FooBar<T>
58     : Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
59     where J: Bar
60 {
61     fn test();
62 }
63
64 trait WhereList<T, J>
65     where T: Foo,
66           J: Bar
67 {
68 }