diff options
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/tests.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index d2926ba78..eb43a23da 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs | |||
@@ -17,6 +17,18 @@ struct Foo { | |||
17 | pub y: i32, | 17 | pub y: i32, |
18 | } | 18 | } |
19 | 19 | ||
20 | trait Bar { | ||
21 | fn bar(&self) -> i32; | ||
22 | } | ||
23 | |||
24 | impl Bar for Foo { | ||
25 | fn bar(&self) -> i32 { | ||
26 | self.x | ||
27 | } | ||
28 | } | ||
29 | |||
30 | static mut STATIC_MUT: i32 = 0; | ||
31 | |||
20 | fn foo<'a, T>() -> T { | 32 | fn foo<'a, T>() -> T { |
21 | foo::<'a, i32>() | 33 | foo::<'a, i32>() |
22 | } | 34 | } |
@@ -40,7 +52,14 @@ fn main() { | |||
40 | let x = 92; | 52 | let x = 92; |
41 | vec.push(Foo { x, y: 1 }); | 53 | vec.push(Foo { x, y: 1 }); |
42 | } | 54 | } |
43 | unsafe { vec.set_len(0); } | 55 | unsafe { |
56 | vec.set_len(0); | ||
57 | STATIC_MUT = 1; | ||
58 | } | ||
59 | |||
60 | for e in vec { | ||
61 | // Do nothing | ||
62 | } | ||
44 | 63 | ||
45 | let mut x = 42; | 64 | let mut x = 42; |
46 | let y = &mut x; | 65 | let y = &mut x; |