This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
25b152397d
rust
/
src
/
test
/
compile-fail
/
writing-to-immutable-rec.rs
3 lines
96 B
Rust
Raw
Normal View
History
Unescape
Escape
Move mutability checking into its own pass. 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.
2011-08-31 11:45:37 -05:00
// error-pattern: assigning to immutable field
Reformat This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-19 17:16:48 -05:00
fn
main
(
)
{
let
r
:
{
x
:
int
}
=
{
x
:
1
}
;
r
.
x
=
6
;
}
Reference in New Issue
Copy Permalink