Closed
Description
hang.rs
fn main() {
let mut v: Vec<&()> = Vec::new();
v.sort_by_key(|&r| r as *const ());
}
Meta
rustc --version --verbose
:
rustc --version --verbose
rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-apple-darwin
release: 1.46.0
LLVM version: 10.0
Error output
I compile with this:
rustc hang.rs -C opt-level=2 --target wasm32-unknown-unknown
And that hangs rustc
.
Details
opt-level
must be 2 or higher, and --target
must be wasm32-unknown-unknown
.
It does NOT hang with rustc 1.48.0-nightly (d006f5734 2020-08-28)
, so possibly this is a bug that has already been fixed.
Metadata
Metadata
Assignees
Labels
Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Target: WASM (WebAssembly), http://webassembly.org/Relevant to the compiler team, which will review and decide on the PR/issue.