-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Description
I was playing around with AtomicOption
and realized that it does not require the correct bound (which I believe should be Send
) for its type parameter. Thus, you can do this:
use std::sync::atomic::{AtomicOption, SeqCst};
struct Foo<'a> { foo: AtomicOption<&'a Foo<'a>>, id: Box<u8> }
fn main() {
let foo = Foo { foo: AtomicOption::empty(), id: box 10 };
foo.foo.fill(box &foo, SeqCst);
spawn(proc() {
let foo = foo;
println!("{}", foo.foo.take(SeqCst).unwrap().id);
});
}
Segmentation fault: 11
Metadata
Metadata
Assignees
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.