rust/src
bors 9ed5b94b28 Auto merge of #90373 - tmiasko:union-qualification, r=oli-obk
Use type based qualification for unions

Union field access is currently qualified based on the qualification of
a value previously assigned to the union. At the same time, every union
access transmutes the content of the union, which might result in a
different qualification.

For example, consider constants A and B as defined below, under the
current rules neither contains interior mutability, since a value used
in the initial assignment did not contain `UnsafeCell` constructor.

```rust
#![feature(untagged_unions)]

union U { i: u32, c: std::cell::Cell<u32> }
const A: U = U { i: 0 };
const B: std::cell::Cell<u32> = unsafe { U { i: 0 }.c };
```

To avoid the issue, the changes here propose to consider the content of
a union as opaque and use type based qualification for union types.

Fixes #90268.

`@rust-lang/wg-const-eval`
2021-10-29 12:21:09 +00:00
..
bootstrap remove "field is never read" warning 2021-10-23 21:55:57 -04:00
build_helper Migrate to 2021 2021-09-20 22:21:42 -04:00
ci Move back to linux builder on try builds 2021-10-25 09:38:24 -04:00
doc Rollup merge of #90082 - noncombatant:patch-1, r=GuillaumeGomez 2021-10-29 00:30:30 +02:00
etc Encode json files with UTF-8 2021-09-30 00:11:14 +09:00
librustdoc Improve perf measurements of build_extern_trait_impl 2021-10-27 20:15:00 -07:00
llvm-project@a7348ae0df Update to the final LLVM 13.0.0 release 2021-10-01 21:06:19 -07:00
rustdoc-json-types Moved format-version constant to rustdoc-json-types 2021-10-15 12:27:42 +03:00
test Auto merge of #90373 - tmiasko:union-qualification, r=oli-obk 2021-10-29 12:21:09 +00:00
tools Rollup merge of #90154 - camelid:remove-getdefid, r=jyn514 2021-10-27 06:11:35 +02:00
README.md
stage0.json bump boostrap compiler 2021-10-23 21:55:57 -04:00
version bump version to rust 1.58.0 2021-10-17 16:04:44 +02:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.