about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2021-01-29 20:09:07 +0100
committerMiguel Ojeda <ojeda@kernel.org>2021-01-29 20:25:23 +0100
commitc7f4154c6a839d31abcbb74be4c9b2404ae3a2ec (patch)
tree696e9f0405ec5be8897c12f6e3b1f2ef522630d6 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentc4e33b51c1a2d5e599b949fa3006467b88df253a (diff)
downloadrust-c7f4154c6a839d31abcbb74be4c9b2404ae3a2ec.tar.gz
rust-c7f4154c6a839d31abcbb74be4c9b2404ae3a2ec.zip
sys: use `process::abort()` instead of `arch::wasm32::unreachable()`
Rationale:

  - `abort()` lowers to `wasm32::unreachable()` anyway.
  - `abort()` isn't `unsafe`.
  - `abort()` matches the comment better.
  - `abort()` avoids confusion by future readers (e.g.
    https://github.com/rust-lang/rust/pull/81527): the naming of wasm's
    `unreachable' instruction is a bit unfortunate because it is not
    related to the `unreachable()` intrinsic (intended to trigger UB).

Codegen is likely to be different since `unreachable()` is `inline`
while `abort()` is `cold`. Since it doesn't look like we are expecting
here to trigger this case, the latter seems better anyway.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions