Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct X<'a> {
- v: &'a mut u32,
- }
- fn v<'a>(x: &'a mut X<'a>) -> &'a mut u32 { x.v }
- fn b<'a>(x: &'a mut X<'a>) -> u32 {
- let u = *v(x);
- let v = *v(x);
- u + v
- }
- fn main() {
- let mut x = 0;
- b(&mut X { v: &mut x });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement