aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
authorPaul Daniel Faria <[email protected]>2020-09-06 17:26:53 +0100
committerPaul Daniel Faria <[email protected]>2020-09-06 17:26:53 +0100
commit7af947a032bd2e6f6df6b903b40f142cd7b8d9e0 (patch)
treea3a07fc4d44f56339d70f2094cf3cc3ce96c20f3 /crates/ide/src/syntax_highlighting/tests.rs
parent0275b08d1521606fa733f76fe5d5707717456fb4 (diff)
Add consuming modifier to lvalues that are passed by value and not Copy
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 6f72a29bd..57d4e1252 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -35,8 +35,8 @@ impl Bar for Foo {
35} 35}
36 36
37impl Foo { 37impl Foo {
38 fn baz(mut self) -> i32 { 38 fn baz(mut self, f: Foo) -> i32 {
39 self.x 39 f.baz(self)
40 } 40 }
41 41
42 fn qux(&mut self) { 42 fn qux(&mut self) {
@@ -54,8 +54,8 @@ struct FooCopy {
54} 54}
55 55
56impl FooCopy { 56impl FooCopy {
57 fn baz(self) -> u32 { 57 fn baz(self, f: FooCopy) -> u32 {
58 self.x 58 f.baz(self)
59 } 59 }
60 60
61 fn qux(&mut self) { 61 fn qux(&mut self) {
@@ -118,14 +118,15 @@ fn main() {
118 y; 118 y;
119 119
120 let mut foo = Foo { x, y: x }; 120 let mut foo = Foo { x, y: x };
121 let foo2 = foo.clone();
121 foo.quop(); 122 foo.quop();
122 foo.qux(); 123 foo.qux();
123 foo.baz(); 124 foo.baz(foo2);
124 125
125 let mut copy = FooCopy { x }; 126 let mut copy = FooCopy { x };
126 copy.quop(); 127 copy.quop();
127 copy.qux(); 128 copy.qux();
128 copy.baz(); 129 copy.baz(copy);
129} 130}
130 131
131enum Option<T> { 132enum Option<T> {