rust/src
bors b3df0d7e5e Auto merge of - saethlin:compiler-builtins-can-panic, r=pnkfelix
"Handle" calls to upstream monomorphizations in compiler_builtins

This is pretty cooked, but I think it works.

compiler-builtins has a long-standing problem that at link time, its rlib cannot contain any calls to `core`. And yet, in codegen we _love_ inserting calls to symbols in `core`, generally from various panic entrypoints.

I intend this PR to attack that problem as completely as possible. When we generate a function call, we now check if we are generating a function call from `compiler_builtins` and whether the callee is a function which was not lowered in the current crate, meaning we will have to link to it.

If those conditions are met, actually generating the call is asking for a linker error. So we don't. If the callee diverges, we lower to an abort with the same behavior as `core::intrinsics::abort`. If the callee does not diverge, we produce an error. This means that compiler-builtins can contain panics, but they'll SIGILL instead of panicking. I made non-diverging calls a compile error because I'm guessing that they'd mostly get into compiler-builtins by someone making a mistake while working on the crate, and compile errors are better than linker errors. We could turn such calls into aborts as well if that's preferred.
2024-03-22 16:55:11 +00:00
..
bootstrap Rollup merge of - onur-ozkan:less-verbose-fail-logs, r=clubby789 2024-03-22 01:07:31 +01:00
ci Inherit RUSTC_BOOTSTRAP when testing wasm 2024-03-20 14:42:30 -07:00
doc Rollup merge of - RossSmyth:pfix_match, r=petrochenkov 2024-03-22 11:36:58 +01:00
etc Auto merge of - reitermarkus:generic-nonzero-inner, r=oli-obk,wesleywiser 2024-03-17 02:27:52 +00:00
librustdoc Rename AstConv to HIR ty lowering 2024-03-22 06:31:40 +01:00
llvm-project@0af6c732ec Update to LLVM 18.1.2 2024-03-20 12:26:19 +01:00
rustdoc-json-types Add is_object_safe information for traits in JSON output 2023-12-23 11:43:31 +01:00
tools Auto merge of - saethlin:compiler-builtins-can-panic, r=pnkfelix 2024-03-22 16:55:11 +00:00
README.md
stage0.json Bump stage0 2024-03-19 19:27:24 -04:00
version Bump to 1.79.0 2024-03-16 09:56:09 -04: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.