Merge remote-tracking branch 'origin/master' into rustup

This commit is contained in:
Ralf Jung 2018-09-24 23:00:58 +02:00
commit 2b882f3feb
3 changed files with 23 additions and 1 deletions

View File

@ -1 +1 @@
nightly-2018-09-18
nightly-2018-09-22

View File

@ -0,0 +1,16 @@
#![allow(dead_code)]
#[repr(u16)]
enum DeviceKind {
Nil = 0,
}
#[repr(packed)]
struct DeviceInfo {
endianness: u8,
device_kind: DeviceKind,
}
fn main() {
let _x = None::<(DeviceInfo, u8)>;
let _y = None::<(DeviceInfo, u16)>;
let _z = None::<(DeviceInfo, u64)>;
}

View File

@ -1,8 +1,14 @@
use std::sync::atomic::{Ordering, AtomicUsize};
static mut X: usize = 5;
static Y: AtomicUsize = AtomicUsize::new(5);
fn main() {
unsafe {
X = 6;
assert_eq!(X, 6);
}
Y.store(6, Ordering::Relaxed);
assert_eq!(Y.load(Ordering::Relaxed), 6);
}