rust/src
bors 2f278c57ff Auto merge of #42083 - petrochenkov:safeassign, r=nikomatsakis
Make assignments to `Copy` union fields safe

This is an accompanying PR to PR https://github.com/rust-lang/rust/pull/42068 stabilizing FFI unions.

This was first proposed in https://github.com/rust-lang/rust/issues/32836#issuecomment-281296416, see subsequent comments as well.
Assignments to `Copy` union fields do not read any data from the union and are [equivalent](https://github.com/rust-lang/rust/issues/32836#issuecomment-281660298) to whole union assignments, which are safe, so they should be safe as well. This removes a significant number of "false positive" unsafe blocks, in code dealing with FFI unions in particular.

It desirable to make this change now, together with stabilization of FFI unions, because now it affecfts only unstable code, but later it will cause warnings/errors caused by `unused_unsafe` lint in stable code.

cc #32836
r? @nikomatsakis
2017-05-26 10:17:51 +00:00
..
bootstrap Auto merge of #41932 - wesleywiser:py-to-rust, r=alexcrichton 2017-05-25 10:35:04 +00:00
build_helper Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin. 2017-04-25 10:31:01 +08:00
ci Update OpenSSL download location 2017-05-25 10:08:35 -07:00
compiler-rt@c8a8767c56 support `default impl` for specialization 2017-04-25 05:28:22 +00:00
doc Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakis 2017-05-26 07:36:25 +00:00
driver
etc Rewrite make-win-dist.py in Rust 2017-05-14 21:24:29 -04:00
grammar Re-add LALR grammar. 2017-05-08 09:47:05 -06:00
jemalloc@3288e0659c Update jemalloc to 4.5.0 2017-05-10 18:36:24 +02:00
liballoc Correct some stability versions 2017-05-20 08:38:39 +01:00
liballoc_jemalloc Update jemalloc to 4.5.0 2017-05-10 18:36:24 +02:00
liballoc_system Specialize Vec::from_elem<u8> to use calloc or memset 2017-04-15 09:01:56 -07:00
libarena migrate everything to using mem::needs_drop 2017-05-20 19:27:30 -04:00
libbacktrace
libcollections Rollup merge of #42134 - scottmcm:rangeinclusive-struct, r=aturon 2017-05-24 19:50:01 -06:00
libcompiler_builtins Auto merge of #40123 - TimNN:llvm40, r=alexcrichton 2017-04-24 22:18:16 +00:00
libcore Rollup merge of #42195 - SamWhited:fix_broken_link, r=steveklabnik 2017-05-24 19:50:09 -06:00
libflate rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
libfmt_macros rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
libgetopts rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
libgraphviz rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
liblibc@03562b0cb2 Reload nameserver information on lookup failure 2017-05-04 23:59:55 -04:00
libpanic_abort
libpanic_unwind Fix definitions of ULONG_PTR 2017-05-06 15:46:16 +01:00
libproc_macro Add doc attributes to proc_macro crate 2017-03-12 02:54:43 +00:00
libproc_macro_plugin Fix #35829 (syntax extension's `quote_expr!()` does not handle b"…") 2017-05-13 21:41:25 +08:00
librand Removal pass for anonymous parameters 2017-05-02 05:55:20 +02:00
librustc Auto merge of #42083 - petrochenkov:safeassign, r=nikomatsakis 2017-05-26 10:17:51 +00:00
librustc_asan Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin. 2017-04-25 10:31:01 +08:00
librustc_back add thiscall calling convention support 2017-05-24 16:40:03 -04:00
librustc_bitflags rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
librustc_borrowck rename `parameter_environment` to `param_env` 2017-05-22 15:55:56 -04:00
librustc_const_eval Hygienize `librustc_typeck`. 2017-05-25 05:52:05 +00:00
librustc_const_math rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
librustc_data_structures rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
librustc_driver Rollup merge of #42150 - citizen428:feature/error-count-messages, r=Mark-Simulacrum 2017-05-24 19:50:05 -06:00
librustc_errors Change error count messages 2017-05-24 16:14:38 +07:00
librustc_incremental Use 128 instead of 64 bits for DefPath hashes 2017-05-18 11:10:11 +02:00
librustc_lint rename `parameter_environment` to `param_env` 2017-05-22 15:55:56 -04:00
librustc_llvm add thiscall calling convention support 2017-05-24 16:40:03 -04:00
librustc_lsan Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin. 2017-04-25 10:31:01 +08:00
librustc_metadata Improve intercrate hygiene. 2017-05-25 05:52:11 +00:00
librustc_mir Auto merge of #42023 - nikomatsakis:issue-36799-ostn15_phf, r=arielb1 2017-05-23 09:55:40 +00:00
librustc_msan Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin. 2017-04-25 10:31:01 +08:00
librustc_passes Hygienize lifetimes. 2017-05-25 05:52:09 +00:00
librustc_platform_intrinsics rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
librustc_plugin Support #[allow] etc logic on a per macro level 2017-05-13 16:02:29 +02:00
librustc_privacy Hygienize `librustc_privacy`. 2017-05-25 05:52:08 +00:00
librustc_resolve Improve `Self`. 2017-05-25 05:52:13 +00:00
librustc_save_analysis Hygienize lifetimes. 2017-05-25 05:52:09 +00:00
librustc_trans add thiscall calling convention support 2017-05-24 16:40:03 -04:00
librustc_tsan Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin. 2017-04-25 10:31:01 +08:00
librustc_typeck Hygienize `librustc_typeck`. 2017-05-25 05:52:05 +00:00
librustdoc Auto merge of #40847 - jseyfried:decl_macro, r=nrc 2017-05-25 22:31:34 +00:00
libserialize rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
libstd Rollup merge of #42198 - GuillaumeGomez:os-str-doc, r=QuietMisdreavus 2017-05-24 19:50:10 -06:00
libstd_unicode Auto merge of #41659 - bluss:clone-split-whitespace, r=aturon 2017-05-10 03:27:36 +00:00
libsyntax Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakis 2017-05-26 07:36:25 +00:00
libsyntax_ext Hygienize lifetimes. 2017-05-25 05:52:09 +00:00
libsyntax_pos Improve intercrate hygiene. 2017-05-25 05:52:11 +00:00
libterm rustc: Remove #![unstable] annotation 2017-05-11 16:03:05 -07:00
libtest Number of filtered out tests in tests summary 2017-05-11 23:20:09 +03:00
libunwind Haiku: fix initial platform support 2017-04-22 13:47:36 +12:00
llvm@1ef3b9128e LLVM: Add support for EABI-compliant libcalls on MSP430. 2017-05-13 21:23:00 +03:00
rt support `default impl` for specialization 2017-04-25 05:28:22 +00:00
rtstartup Update stage0 bootstrap compiler 2017-04-29 12:11:14 -07:00
rustc Fix plain_summary_line function 2017-03-28 11:38:56 -06:00
rustllvm LLVM: Add support for EABI-compliant libcalls on MSP430. 2017-05-13 21:23:00 +03:00
test Auto merge of #42083 - petrochenkov:safeassign, r=nikomatsakis 2017-05-26 10:17:51 +00:00
tools Rollup merge of #42191 - alexcrichton:update-cargo, r=Mark-Simulacrum 2017-05-24 19:50:09 -06:00
Cargo.lock Update Cargo submodule 2017-05-24 12:59:58 -07:00
Cargo.toml Revert "Reenable opt-level 3" 2017-05-20 10:33:53 -06:00
stage0.txt Update stage0 bootstrap compiler 2017-04-29 12:11:14 -07:00