rust/src
Matthias Krüger 56959e5fe3
Rollup merge of #109373 - ids1024:llvm-unreachable-optimize, r=ozkanonur
Set LLVM `LLVM_UNREACHABLE_OPTIMIZE` to `OFF`

This option was added to LLVM in https://reviews.llvm.org/D121750?id=416339. It makes `llvm_unreachable` in builds without assertions compile to an `LLVM_BUILTIN_TRAP` instead of `LLVM_BUILTIN_UNREACHABLE` (which causes undefined behavior and is equivalent to `std::hint::unreachable_unchecked`).

Having compiler bugs triggering undefined behavior generally seems undesirable and inconsistent with Rust's goals. There is a check in `src/tools/tidy/src/style.rs` to reject code using `llvm_unreachable`. But it is used a lot within LLVM itself.

For instance, this changes a failure I get compiling `libcore` for m68k from a `SIGSEGV` to `SIGILL`, which seems better though it still doesn't provide a useful message without switching to an LLVM build with asserts.

It may be best not to do this if it noticeably degrades compiler performance, but worthwhile if it doesn't do so in any significant way. I haven't looked into what benchmarks there are for Rustc. That should be considered before merging.
2023-03-22 20:08:00 +01:00
..
bootstrap Rollup merge of #109373 - ids1024:llvm-unreachable-optimize, r=ozkanonur 2023-03-22 20:08:00 +01:00
ci Auto merge of #109163 - hi-rustin:rustin-patch-dockerfile, r=Mark-Simulacrum 2023-03-22 11:45:52 +00:00
doc Rollup merge of #108722 - petrhosek:fuchsia-riscv, r=petrochenkov 2023-03-14 17:40:03 +01:00
etc Rename src/etc/vscode_settings.json to rust_analyzer_settings.json 2023-03-01 22:58:05 +05:30
librustdoc Rollup merge of #109266 - petrochenkov:docice4, r=petrochenkov 2023-03-20 09:46:52 +01:00
llvm-project@fd949f3034 Revert "Auto merge of #107224 - nikic:llvm-16, r=cuviper" 2023-03-18 23:49:24 +01:00
rustdoc-json-types fix inconsistent json outputs from rustdoc 2023-03-05 00:09:09 +03:00
tools Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errors 2023-03-22 05:33:18 +00:00
README.md Remove stale reference to the test suite location 2023-01-13 11:49:06 +00:00
stage0.json Bump to latest beta 2023-03-15 08:55:22 -04:00
version Bump version to 1.70.0 2023-03-04 10:10:46 -05: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.