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
{{ message }}
Repository navigation
by-val and by-move can be dangerous when combined #2443
Currently, the compiler does not account for the fact that "by value" passing of ref-counted boxes is in fact a borrow. This can be fixed easily enough in borrowck (or, I imagine, in alias). In any case, I added an xfail'd test (by-val-and-by-move.rs) that demonstrates the problem. This test fails (note the environment variable RUST_POISON_ON_FREE---without that, the test may accidentally pass even though it is accessing a freed pointer).
// xfail-test
// exec-env:RUST_POISON_ON_FREE
fn it_takes_two(x: @int, -y: @int) -> int {
free(y);
#debug["about to deref"];
*x
}
fn free<T>(-t: T) {
}
fn main() {
let z = @3;
assert 3 == it_takes_two(z, z);
}
just realized---this should be easy to fix with borrowck, but we don't handle it now. we don't seem to get the scope right when checking that there is no move from a borrow ptr.
Activity
nikomatsakis commentedon Jun 8, 2012
just realized---this should be easy to fix with borrowck, but we don't handle it now. we don't seem to get the scope right when checking that there is no move from a borrow ptr.
graydon commentedon Aug 31, 2012
Obsolete given scheduled removal of modes (or at least WONTFIX).
removed test referring to WONTFIX bug rust-lang#2443
removed test referring to WONTFIX bug rust-lang#2443
removed test referring to WONTFIX bug rust-lang#2443
Auto merge of rust-lang#2890 - oli-obk:ui_test, r=RalfJung
Auto merge of rust-lang#2901 - oli-obk:noisy, r=RalfJung
Bump Kani dependencies (rust-lang#2443)
Merge pull request rust-lang#2443 from smanilov/patch-21
Merge rust-lang#2466