Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Foo;
- impl Foo {
- fn mutate_and_share(&mut self) -> &Self { &*self }
- fn share(&self) {}
- }
- fn main() {
- let mut foo = Foo;
- let loan = foo.mutate_and_share();
- foo.share();
- let consumer = loan;
- }
Add Comment
Please, Sign In to add comment