-
-
Save abernier/bf04538979b2269744ab050fad11616f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains 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 A { | |
a : i32, | |
} | |
impl A { | |
fn bind_lifetime_mut(&mut self) -> &i32 { | |
return &self.a; | |
} | |
fn legal(&mut self) -> &i32 { | |
self.bind_lifetime_mut(); | |
return self.bind_lifetime_mut(); | |
} | |
fn not_legal(&mut self) -> &i32 { | |
let test_ret = self.bind_lifetime_mut(); | |
if *test_ret == 1 { | |
return test_ret; | |
} | |
return self.bind_lifetime_mut() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment