Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- struct Foo {
- x: u32,
- y: usize,
- }
- fn main() {
- let mut bar = Foo { x: 5, y: 1000032 };
- bar.x = 8;
- let mut baz = &mut bar;
- //bar.x = 10;
- {
- let x = &mut baz;
- x.x = 9;
- baz.x = 7;
- }
- bar.x = 10;
- println!("Hello, world! {:?}", bar);
- }
Add Comment
Please, Sign In to add comment