Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-fail/unwind-misc-1 fails but exits with 0 when core::hashmap is used #5512

Closed
thestinger opened this issue Mar 23, 2013 · 2 comments
Closed

Comments

@thestinger
Copy link
Contributor

fn main() {
    let count = @mut 0u;
    let mut map = core::hashmap::linear::LinearMap::new();
    let mut arr = ~[];
    for uint::range(0u, 10u) |i| {
        arr += ~[@~"key stuff"];
        map.insert(copy arr, arr + ~[@~"value stuff"]);
        if arr.len() == 5 {
            fail!();
        }
    }
}

This is similar to #4547, but it could be a different issue.

@alexcrichton
Copy link
Member

I think this is the same issue because LinearMap uses rand::task_rng which initializes task local data, just like os::args does. That's just a guess though.

@alexcrichton
Copy link
Member

Yes, I believe this is the same as #4547, this program causes the same failure:

use core::hashmap::HashMap;

fn main() {
    let _m = HashMap::new::<int, int>();
    assert!(false);
}

vertexclique pushed a commit to vertexclique/rust that referenced this issue Feb 11, 2014
The reasoning for doing it this way is that it's much easier to transition method-by-method to the `Map` API than trying to do the migration all at once.

I found an issue unrelated to my changes in one of the run-fail tests - if it uses `LinearMap`, it still fails but exits with 0. I xfailed it for now and opened [an issue](rust-lang#5512), because it's not caused by these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants