rust/src
bors b63223c152 Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlin
Insert checks for enum discriminants when debug assertions are enabled

Similar to the existing null-pointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following:
```rust
let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) };
```

An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++.

This check is similar to Miri's capabilities of checking for valid construction of enum values.

This PR is inspired by saethlin@'s PR
https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments!

I also pair-programmed large parts of this together with vabr-g@.

r? `@saethlin`
2025-06-28 10:25:00 +00:00
..
bootstrap Auto merge of #143064 - flip1995:clippy-subtree-update, r=GuillaumeGomez 2025-06-27 20:07:50 +00:00
build_helper Improve error message for rustdoc_json_types tidy check 2025-06-20 16:22:05 +02:00
ci Rollup merge of #143010 - GuillaumeGomez:update-browser-ui-test, r=Kobzol 2025-06-26 20:15:25 -04:00
doc Rollup merge of #142992 - workingjubilee:dont-validate-naughty-abis, r=jieyouxu 2025-06-25 22:14:56 +02:00
etc Remove unused bootstrap flag 2025-06-18 09:38:28 +02:00
gcc@04ce66d8c9 Update src/gcc submodule to 04ce66d8c918de9273bd7101638ad8724edf5e21 2025-05-14 18:02:02 +02:00
librustdoc Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-dead 2025-06-27 22:13:00 +02:00
llvm-project@ed6566573e Update to LLVM 20.1.7 2025-06-13 14:44:34 +08:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types Port #[no_mangle] to new attribute parsing infrastructure 2025-06-22 22:17:04 +02:00
tools Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlin 2025-06-28 10:25:00 +00:00
README.md
stage0 Bump master stage0 compiler 2025-05-27 20:36:00 +08:00
version Bump the version number to 1.90.0 2025-06-20 10:08:52 -07:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

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