2011-10-17 20:51:34 -07:00
|
|
|
fn main() {
|
2012-03-22 20:06:01 -07:00
|
|
|
// Note: explicit type annot is required here
|
|
|
|
// because otherwise the inference gets smart
|
2012-06-29 16:26:56 -07:00
|
|
|
// and assigns a type of ~[mut ~[const int]].
|
|
|
|
let v: ~[mut ~[int]] = ~[mut ~[0]];
|
2011-10-17 20:51:34 -07:00
|
|
|
|
2012-06-29 16:26:56 -07:00
|
|
|
fn f(&&v: ~[mut ~[const int]]) {
|
2012-07-14 13:55:41 -07:00
|
|
|
v[0] = ~[mut 3]
|
2011-10-17 20:51:34 -07:00
|
|
|
}
|
|
|
|
|
2012-06-30 12:23:59 +01:00
|
|
|
f(v); //~ ERROR (values differ in mutability)
|
2011-10-17 20:51:34 -07:00
|
|
|
}
|