1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#[test]
fn impl_in_other_mod() {
struct Foo;
mod lol {
use super::Foo;
impl Foo {
fn lol(self) {
2
}
}
}
assert_eq!(Foo.lol(), 2);
}
#[test]
fn impl_in_super() {
struct Foo;
mod lol {
impl super::Foo {
fn lol(self) {
3
}
}
}
assert_eq!(Foo.lol(), 3);
}
#[test]
fn impl_in_block() {
struct Foo;
let value = {
impl Foo {
fn lol(self) {
4
}
}
};
assert_eq!(Foo.lol(), 4);
}