diff options
author | Paul Daniel Faria <[email protected]> | 2020-07-30 16:07:13 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-08-16 15:22:51 +0100 |
commit | a044ff0138d6bff9406b94de89fde43e7672ee1b (patch) | |
tree | c90b7a41f15d86b6bf7b6bd4fd4c9c8496197ae3 /crates/ide/src/syntax_highlighting | |
parent | 7009d5ee2bff53b9beb555b1572c97ab3882cd98 (diff) |
Mark mutating functions with `mutable` modifier, and owning functions with `consuming`.
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 94f37d773..6cb955d29 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -36,6 +36,10 @@ impl Foo { | |||
36 | fn qux(&mut self) { | 36 | fn qux(&mut self) { |
37 | self.x = 0; | 37 | self.x = 0; |
38 | } | 38 | } |
39 | |||
40 | fn quop(&self) -> i32 { | ||
41 | self.x | ||
42 | } | ||
39 | } | 43 | } |
40 | 44 | ||
41 | static mut STATIC_MUT: i32 = 0; | 45 | static mut STATIC_MUT: i32 = 0; |
@@ -87,6 +91,11 @@ fn main() { | |||
87 | let Foo { x: z, y } = Foo { x: z, y }; | 91 | let Foo { x: z, y } = Foo { x: z, y }; |
88 | 92 | ||
89 | y; | 93 | y; |
94 | |||
95 | let mut foo = Foo { x, y: x }; | ||
96 | foo.quop(); | ||
97 | foo.qux(); | ||
98 | foo.baz(); | ||
90 | } | 99 | } |
91 | 100 | ||
92 | enum Option<T> { | 101 | enum Option<T> { |