@eddyb I just saw https://github.com/rust-lang/rust/blob/2eb0bc5e3c52a34b6d62ab0527520c66e4c575bd/src/librustc_codegen_llvm/attributes.rs#L282-L286. Doesn't that code make intrinsics
nounwind? We have an intrinsic that compiles to a panic or a NOP;
panic_if_uninhabited. Is that a problem?
Rust intrinsics do not end up being generated as function calls, they are generated as a sequence of instructions inline.
Perhaps a better way to explain this is: you cannot ever get a function pointer to an intrinsic.
The compiler will just throw a block of ice in your face.
okay. I guess I was confused because in MIR, they still are function calls (and that's how Miri sees them). But this code here in in LLVM lowering, so what you say makes sense. Thanks!
nit: a whole bunch of intrinsics do lower to LLVM level calls (of LLVM intrinsics), but I think those don't go through that code path either.