mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
259 B
Rust
21 lines
259 B
Rust
|
// Check that `*y` isn't borrowed after `y = y`.
|
||
|
|
||
|
// check-pass
|
||
|
|
||
|
fn main() {
|
||
|
let mut x = 1;
|
||
|
{
|
||
|
let mut y = &mut x;
|
||
|
y = y;
|
||
|
y;
|
||
|
}
|
||
|
x;
|
||
|
{
|
||
|
let mut y = &mut x;
|
||
|
y = y;
|
||
|
y = y;
|
||
|
y;
|
||
|
}
|
||
|
x;
|
||
|
}
|