Skip to content

syntax_pos::Symbol should not implement Sync #42407

Closed
@dtolnay

Description

@dtolnay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions