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

syntax_pos::Symbol should not implement Sync #42407

Closed
dtolnay opened this issue Jun 3, 2017 · 1 comment
Closed

syntax_pos::Symbol should not implement Sync #42407

dtolnay opened this issue Jun 3, 2017 · 1 comment

Comments

@dtolnay
Copy link
Member

dtolnay commented Jun 3, 2017

It is an index into a thread local vector.

#![feature(rustc_private)]

extern crate syntax_pos;
extern crate crossbeam;

use syntax_pos::symbol::Symbol;

fn assert_sync<T: Sync>() {}

fn main() {
    assert_sync::<Symbol>();

    let sym = Symbol::intern("share");

    crossbeam::scope(|scope| {
        scope.spawn(|| {
            println!("{}", sym);
        });
    });
}
thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 4294967237', /checkout/src/libcollections/vec.rs:1552
@eddyb
Copy link
Member

eddyb commented Jun 4, 2017

I thought @jseyfried had explicit negative impls? What happened to them?

Ahh, there's only a !Send impl, we needs a !Sync one too.

wesleywiser added a commit to wesleywiser/rust that referenced this issue Jun 6, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Jun 7, 2017
syntax_pos::Symbol should not implement Sync

Fixes rust-lang#42407
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