]> git.lizzy.rs Git - rust.git/blob - src/test/ui/auxiliary/inner_static.rs
Auto merge of #91149 - notriddle:notriddle/rustdoc-doctest-semicolon, r=jyn514
[rust.git] / src / test / ui / auxiliary / inner_static.rs
1 pub struct A<T> { pub v: T }
2 pub struct B<T> { pub v: T }
3
4 pub mod test {
5     pub struct A<T> { pub v: T }
6
7     impl<T> A<T> {
8         pub fn foo(&self) -> isize {
9             static a: isize = 5;
10             return a
11         }
12
13         pub fn bar(&self) -> isize {
14             static a: isize = 6;
15             return a;
16         }
17     }
18 }
19
20 impl<T> A<T> {
21     pub fn foo(&self) -> isize {
22         static a: isize = 1;
23         return a
24     }
25
26     pub fn bar(&self) -> isize {
27         static a: isize = 2;
28         return a;
29     }
30 }
31
32 impl<T> B<T> {
33     pub fn foo(&self) -> isize {
34         static a: isize = 3;
35         return a
36     }
37
38     pub fn bar(&self) -> isize {
39         static a: isize = 4;
40         return a;
41     }
42 }
43
44 pub fn foo() -> isize {
45     let a = A { v: () };
46     let b = B { v: () };
47     let c = test::A { v: () };
48     return a.foo() + a.bar() +
49            b.foo() + b.bar() +
50            c.foo() + c.bar();
51 }