You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Borrowck doesn't always propagate mutability correctly to base components.
Here is an example:
struct Foo {
x: uint
}
struct Bar {
foo: Foo
}
fn main() {
let mut b = Bar { foo: Foo { x: 3 } };
let p = &b;
let q = &mut b.foo.x;
let r = &p.foo.x;
io::println(fmt!("*r = %u", *r));
*q += 1;
io::println(fmt!("*r = %u", *r));
}
Here, r has type &uint and thus *r should always yield the same result. The problem is that when creating the loan for &mut we propagate &const as the required type for base loans. This causes us to miss the conflict.
I have a fix for this already prepared.
The text was updated successfully, but these errors were encountered:
Borrowck doesn't always propagate mutability correctly to base components.
Here is an example:
Here, r has type
&uint
and thus*r
should always yield the same result. The problem is that when creating the loan for&mut
we propagate&const
as the required type for base loans. This causes us to miss the conflict.I have a fix for this already prepared.
The text was updated successfully, but these errors were encountered: