rust/src
bors 704e47f78b Auto merge of #78407 - oli-obk:ub_checkable_ctfe, r=RalfJung,pnkfelix
Make CTFE able to check for UB...

... by not doing any optimizations on the `const fn` MIR used in CTFE. This means we duplicate all `const fn`'s MIR now, once for CTFE, once for runtime. This PR is for checking the perf effect, so we have some data when talking about https://github.com/rust-lang/const-eval/blob/master/rfcs/0000-const-ub.md

To do this, we now have two queries for obtaining mir: `optimized_mir` and `mir_for_ctfe`. It is now illegal to invoke `optimized_mir` to obtain the MIR of a const/static item's initializer, an array length, an inline const expression or an enum discriminant initializer. For `const fn`, both `optimized_mir` and `mir_for_ctfe` work, the former returning the MIR that LLVM should use if the function is called at runtime. Similarly it is illegal to invoke `mir_for_ctfe` on regular functions.

This is all checked via appropriate assertions and I don't think it is easy to get wrong, as there should be no `mir_for_ctfe` calls outside the const evaluator or metadata encoding. Almost all rustc devs should keep using `optimized_mir` (or `instance_mir` for that matter).
2021-01-12 17:26:56 +00:00
..
bootstrap Rollup merge of #79997 - coolreader18:wasm-reactor, r=alexcrichton 2021-01-12 07:58:59 +09:00
build_helper Fix even more URLs 2020-11-05 20:11:29 +01:00
ci Auto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrum 2020-12-31 00:23:13 +00:00
doc Fix typo in source-based-code-coverage.md 2021-01-10 22:17:51 +09:00
etc Detect invalid rustdoc test commands 2021-01-03 13:53:11 +01:00
librustdoc Rollup merge of #80885 - camelid:intra-doc-str-ref, r=jyn514 2021-01-12 07:59:15 +09:00
llvm-project@fb115ee43b Update LLVM 2020-12-30 19:14:15 +00:00
test Auto merge of #78407 - oli-obk:ub_checkable_ctfe, r=RalfJung,pnkfelix 2021-01-12 17:26:56 +00:00
tools ast: Remove some indirection layers from values in key-value attributes 2021-01-09 21:50:39 +03:00
README.md Update README.md 2020-08-30 13:40:11 -05:00
stage0.txt Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
version Bump version to 1.51 2020-12-25 10:42:53 -05: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.