Skip to content

Commit ed6e575

Browse files
committed
abi: unhide bool's niche, breaking Option<bool> for Rust-GPU but allowing libcore to build.
1 parent 4fcac6a commit ed6e575

File tree

1 file changed

+8
-1
lines changed
  • crates/rustc_codegen_spirv/src

1 file changed

+8
-1
lines changed

crates/rustc_codegen_spirv/src/abi.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,14 @@ pub(crate) fn provide(providers: &mut Providers) {
249249

250250
#[allow(clippy::match_like_matches_macro)]
251251
let hide_niche = match ty.kind() {
252-
ty::Bool => true,
252+
ty::Bool => {
253+
// HACK(eddyb) we can't bypass e.g. `Option<bool>` being a byte,
254+
// due to `core` PR https://github.com/rust-lang/rust/pull/138881
255+
// (which adds a new `transmute`, from `ControlFlow<bool>` to `u8`).
256+
let libcore_needs_bool_niche = true;
257+
258+
!libcore_needs_bool_niche
259+
}
253260
_ => false,
254261
};
255262

0 commit comments

Comments
 (0)