2011-10-17 22:51:34 -05:00
|
|
|
fn main() {
|
2012-03-22 22:06:01 -05:00
|
|
|
// Note: explicit type annot is required here
|
|
|
|
// because otherwise the inference gets smart
|
|
|
|
// and assigns a type of [mut [const int]].
|
2012-03-26 20:35:18 -05:00
|
|
|
let v: [mut [mut int]] = [mut [mut 0]];
|
2011-10-17 22:51:34 -05:00
|
|
|
|
2012-03-26 20:35:18 -05:00
|
|
|
fn f(&&v: [mut [const int]]) {
|
2011-10-17 22:51:34 -05:00
|
|
|
v[0] = [3]
|
|
|
|
}
|
|
|
|
|
2012-03-22 22:06:01 -05:00
|
|
|
f(v); //! ERROR (values differ in mutability)
|
2011-10-17 22:51:34 -05:00
|
|
|
}
|