rust/src/libcore
bors 39e9516532 Auto merge of #51990 - oli-obk:unstable_union, r=nikomatsakis
Place unions, pointer casts and pointer derefs behind extra feature gates

To ensure we don't stabilize these things together with const fn stabilization (or any other stabilization)

This PR moves union field accesses inside `const fn` behind a feature gate. It was possible without a feature gate before, but since `const fn` was behind a feature gate we can do this change.

While "dereferencing raw pointers" and "casting raw pointers to usize" were hard errors before this PR, one could work around them by abusing unions:

```rust
// deref
union Foo<T> {
    x: &'static T,
    y: *const T,
}
const FOO: u32 = unsafe { *Foo { y: 42 as *const T }.x };

// as usize cast
union Bar<T> {
    x: usize,
    y: *const T,
}
const BAR: usize = unsafe { Bar { y: &1u8 }.x };
```

r? @eddyb

cc @nikomatsakis
2018-08-07 13:14:37 +00:00
..
benches Move deny(warnings) into rustbuild 2018-04-08 16:59:14 -06:00
char Correct invalid feature attributes 2018-08-05 15:54:49 +01:00
fmt Enforce #![deny(bare_trait_objects)] in src/libcore 2018-07-25 10:21:41 +09:00
future Implement Unpin for FutureObj and LocalFutureObj 2018-07-30 09:42:34 -07:00
hash impl PartialEq+Eq for BuildHasherDefault 2018-07-15 17:37:46 +02:00
iter Remove redundant field names in structs 2018-08-04 14:58:20 +02:00
num Correct invalid feature attributes 2018-08-05 15:54:49 +01:00
ops Fix a typo in unsize.rs 2018-07-31 16:28:50 +03:00
prelude Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
slice Correct invalid feature attributes 2018-08-05 15:54:49 +01:00
str deleted changed lines 2018-08-04 05:51:02 +02:00
sync Switch to bootstrapping from 1.29 beta 2018-08-01 11:59:08 -06:00
task Rename Executor trait to Spawn 2018-08-06 12:18:47 +02:00
tests Fix 2018 edition tests 2018-08-05 15:54:49 +01:00
unicode Auto merge of #51609 - dscorbett:is_numeric, r=alexcrichton 2018-08-01 17:44:25 +00:00
alloc.rs Switch to bootstrapping from 1.29 beta 2018-08-01 11:59:08 -06:00
any.rs Enforce #![deny(bare_trait_objects)] in src/libcore 2018-07-25 10:21:41 +09:00
array.rs Revert "Stabilize the TryFrom and TryInto traits" 2018-04-20 18:10:00 +02:00
ascii.rs migrate codebase to ..= inclusive range patterns 2018-06-26 07:53:30 -07:00
borrow.rs Fix formatting. 2018-03-18 13:05:00 +01:00
Cargo.toml Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
cell.rs Remove redundant field names in structs 2018-08-04 14:58:20 +02:00
clone.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
cmp.rs Add message to rustc_on_unimplemented attributes in core 2018-06-19 15:19:13 -07:00
convert.rs AsRef doc wording tweaks 2018-07-15 10:16:36 +10:00
default.rs Fix "Quasi-quoting is inefficient" warning in incremental rustbuild. 2017-07-18 01:49:40 +08:00
hint.rs Stabilize core::hint::unreachable_unchecked. 2018-04-16 18:29:40 +08:00
internal_macros.rs Switch to 1.26 bootstrap compiler 2018-05-17 08:47:25 -06:00
intrinsics.rs Switch to bootstrapping from 1.29 beta 2018-08-01 11:59:08 -06:00
iter_private.rs Various fixes to wording consistency in the docs 2017-03-22 17:19:52 +01:00
lib.rs Place unions, pointer casts and pointer derefs behind extra feature gates 2018-08-07 14:41:33 +02:00
macros.rs Avoid using #[macro_export] for documenting builtin macros 2018-07-21 02:49:34 +03:00
marker.rs Fix doc link 2018-07-17 14:10:11 +02:00
mem.rs Switch to bootstrapping from 1.29 beta 2018-08-01 11:59:08 -06:00
nonzero.rs Add #[repr(transparent)] to some libcore types 2018-06-16 18:25:15 +02:00
option.rs resolved upstream merge conflicts 2018-07-29 22:13:12 -07:00
panic.rs Enforce #![deny(bare_trait_objects)] in src/libcore 2018-07-25 10:21:41 +09:00
panicking.rs Bootstrap from 1.28.0-beta.3 2018-06-30 13:17:49 -07:00
ptr.rs volatile operations docs: clarify that this does not help wrt. concurrency 2018-08-03 12:15:00 +02:00
raw.rs Fix up various links 2017-03-20 10:10:16 -04:00
result.rs resolved upstream merge conflicts 2018-07-29 22:13:12 -07:00
time.rs Remove redundant field names in structs 2018-08-04 14:58:20 +02:00
tuple.rs Update bootstrap compiler 2017-08-31 06:58:58 -07:00
unit.rs impl FromIterator<()> for () 2017-10-18 23:12:37 -07:00