Last active
December 15, 2015 01:49
-
-
Save Dretch/5183087 to your computer and use it in GitHub Desktop.
Rustc does not like this code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyStruct {} | |
impl MyStruct { | |
fn takes_mut_self(&mut self, _x:int) {} | |
fn takes_self(&self) -> int { 42 } | |
fn also_takes_mut_self(&mut self) { | |
self.takes_mut_self(self.takes_self()); | |
} | |
} | |
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mut-self-issues.rs:12:28: 12:32 error: loan of dereference of mutable & pointer as immutable conflicts with prior loan | |
mut-self-issues.rs:12 self.takes_mut_self(self.takes_self()); | |
^~~~ | |
mut-self-issues.rs:12:8: 12:12 note: prior loan as mutable granted here | |
mut-self-issues.rs:12 self.takes_mut_self(self.takes_self()); | |
^~~~ | |
error: aborting due to previous error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment