mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Mark mutating functions with mutable
modifier, and owning functions with consuming
.
This commit is contained in:
parent
7009d5ee2b
commit
a044ff0138
5 changed files with 70 additions and 15 deletions
|
@ -36,6 +36,10 @@ impl Foo {
|
|||
fn qux(&mut self) {
|
||||
self.x = 0;
|
||||
}
|
||||
|
||||
fn quop(&self) -> i32 {
|
||||
self.x
|
||||
}
|
||||
}
|
||||
|
||||
static mut STATIC_MUT: i32 = 0;
|
||||
|
@ -87,6 +91,11 @@ fn main() {
|
|||
let Foo { x: z, y } = Foo { x: z, y };
|
||||
|
||||
y;
|
||||
|
||||
let mut foo = Foo { x, y: x };
|
||||
foo.quop();
|
||||
foo.qux();
|
||||
foo.baz();
|
||||
}
|
||||
|
||||
enum Option<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue