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

Concurrent thin documents allowed, which can break memory safety #34

Open
shepmaster opened this issue Jan 15, 2016 · 1 comment
Open

Comments

@shepmaster
Copy link
Owner

fn double_thin_document() {
    let p1 = Package::new();

    let (s1, mut c1) = p1.as_thin_document();
    let (s2, mut c2) = p1.as_thin_document();

    for _ in 0..10 {
        let c = s1.create_comment("hi");
        c1.append_root_child(c);
    }

    for c in c1.root_children() {
        let e = s2.create_comment("bye");
        c2.append_root_child(e);

        println!("{:?}", c);
    }
}
@shepmaster
Copy link
Owner Author

idea: as_thin_document() requires &mut ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant