9ff6f816ba
It now threads information about invalidated aliases through the AST properly. This makes it more permissive for conditionals (invalidating an alias in one branch doesn't prevent you from using it in another), and less permissive for loops (it now properly notices when a loop invalidates an alias that it might still use in another iteration). Closes #1144
11 lines
166 B
Rust
11 lines
166 B
Rust
// error-pattern: overwriting x will invalidate reference y
|
|
|
|
fn main() {
|
|
let x = [];
|
|
let &y = x;
|
|
while true {
|
|
log_err y;
|
|
x = [1];
|
|
}
|
|
}
|