auto merge of #19250 : kmcallister/rust/atomicoption, r=alexcrichton
Fixes #19247.
This commit is contained in:
commit
377d7524a8
3 changed files with 35 additions and 3 deletions
16
src/test/compile-fail/atomicoption-not-send-ref.rs
Normal file
16
src/test/compile-fail/atomicoption-not-send-ref.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::sync::atomic::AtomicOption;
|
||||
|
||||
fn main() {
|
||||
let x = 0u;
|
||||
AtomicOption::new(box &x); //~ ERROR `x` does not live long enough
|
||||
}
|
||||
16
src/test/compile-fail/atomicoption-not-send.rs
Normal file
16
src/test/compile-fail/atomicoption-not-send.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::kinds::marker;
|
||||
use std::sync::atomic::AtomicOption;
|
||||
|
||||
fn main() {
|
||||
AtomicOption::new(box marker::NoSend); //~ ERROR `core::kinds::Send` is not implemented
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue