]> git.lizzy.rs Git - rust.git/blob - tests/target/spaces-within-angle-brackets.rs
Fix bug in identifying comments
[rust.git] / tests / target / spaces-within-angle-brackets.rs
1 // rustfmt-spaces_within_angle_brackets: true
2
3 struct Foo< T > {
4     i: T,
5 }
6
7 struct Bar< T, E > {
8     i: T,
9     e: E,
10 }
11
12 struct Foo< 'a > {
13     i: &'a str,
14 }
15
16 enum E< T > {
17     T(T),
18 }
19
20 enum E< T, S > {
21     T(T),
22     S(S),
23 }
24
25 fn foo< T >(a: T) {
26     foo::< u32 >(10);
27 }
28
29 fn foo< T, E >(a: T, b: E) {
30     foo::< u32, str >(10, "bar");
31 }
32
33 fn foo< T: Send, E: Send >(a: T, b: E) {
34
35     foo::< u32, str >(10, "bar");
36
37     let opt: Option< u32 >;
38     let res: Result< u32, String >;
39 }
40
41 fn foo< 'a >(a: &'a str) {
42     foo("foo");
43 }
44
45 fn foo< 'a, 'b >(a: &'a str, b: &'b str) {
46     foo("foo", "bar");
47 }
48
49 impl Foo {
50     fn bar() {
51         < Foo as Foo >::bar();
52     }
53 }
54
55 trait MyTrait< A, D > {}
56 impl< A: Send, D: Send > MyTrait< A, D > for Foo {}
57
58 fn foo() where for< 'a > u32: 'a {}