]> git.lizzy.rs Git - rust.git/blob - tests/target/fn.rs
Merge pull request #122 from cassiersg/fix-mod
[rust.git] / tests / target / fn.rs
1 // Tests different fns
2
3 fn foo(a: AAAA, b: BBB, c: CCC) -> RetType {
4
5 }
6
7 fn foo(a: AAAA, b: BBB /* some, weird, inline comment */, c: CCC) -> RetType
8     where T: Blah
9 {
10
11 }
12
13 fn foo(a: AAA /* (comment) */)
14     where T: Blah
15 {
16
17 }
18
19 fn foo(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
20        b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
21        -> RetType
22     where T: Blah
23 {
24
25 }
26
27
28 fn foo<U, T>(a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
29              b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB)
30              -> RetType
31     where T: Blah,
32           U: dsfasdfasdfasd
33 {
34
35 }
36
37 fn foo<U: Fn(A) -> B /* paren inside generics */>() {
38 }
39
40 impl Foo {
41     fn with_no_errors<T, F>(&mut self, f: F) -> T
42         where F: FnOnce(&mut Resolver) -> T
43     {
44     }
45
46     fn foo(mut self, mut bar: u32) {
47     }
48
49     fn bar(self, mut bazz: u32) {
50     }
51 }
52
53 pub fn render<'a,
54               N: Clone + 'a,
55               E: Clone + 'a,
56               G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
57               W: Write>
58     (g: &'a G,
59      w: &mut W)
60      -> io::Result<()> {
61     render_opts(g, w, &[])
62 }
63
64 const fn foo() {
65     x;
66 }
67
68 pub const fn foo() {
69     x;
70 }
71
72 impl Foo {
73     const fn foo() {
74         x;
75     }
76 }
77
78 fn main() {
79     let _ = function(move || 5);
80     let _ = move || 42;
81 }