Closed
Description
Code
fn main() {
let x: Option<Box<[u8]>> = unsafe {
let z = (0usize, true);
std::mem::transmute::<(usize, bool), Option<Box<[u8]>>>(z)
};
}
Meta
rustc --version --verbose
:
rustc 1.70.0-nightly (2eaeb1eee 2023-04-05)
binary: rustc
commit-hash: 2eaeb1eee1b21772de8b935236d16ff8e03fdcf5
commit-date: 2023-04-05
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.0
Error output
<output>
Backtrace
warning: unused variable: `x`
--> treereduce.out:2:9
|
2 | let x: Option<Box<[u8]>> = unsafe {
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
= note: `#[warn(unused_variables)]` on by default
Invalid bitcast
%7 = bitcast i8 %6 to i64
in function _ZN10treereduce4main17haa15f44c7ccefff9E
LLVM ERROR: Broken function found, compilation aborted!
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from stable to nightly.