Having it in the alias pass was slightly more efficient (finding expression roots has to be done in both passes), but further muddled up the already complex alias checker. Also factors out some duplication in the mutability-checking code.
6 lines
112 B
Rust
6 lines
112 B
Rust
// error-pattern:assigning to immutable object field
|
|
obj objy(x: int) {
|
|
fn foo() { x = 5; }
|
|
}
|
|
fn main() { }
|