Merge remote-tracking branch 'origin/master' into rustup
This commit is contained in:
commit
2b882f3feb
@ -1 +1 @@
|
|||||||
nightly-2018-09-18
|
nightly-2018-09-22
|
||||||
|
16
tests/run-pass/issue-53728.rs
Normal file
16
tests/run-pass/issue-53728.rs
Normal 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)>;
|
||||||
|
}
|
@ -1,8 +1,14 @@
|
|||||||
|
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||||
|
|
||||||
static mut X: usize = 5;
|
static mut X: usize = 5;
|
||||||
|
static Y: AtomicUsize = AtomicUsize::new(5);
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
unsafe {
|
unsafe {
|
||||||
X = 6;
|
X = 6;
|
||||||
assert_eq!(X, 6);
|
assert_eq!(X, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Y.store(6, Ordering::Relaxed);
|
||||||
|
assert_eq!(Y.load(Ordering::Relaxed), 6);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user