Skip to content

rustc hangs when compiling for wasm32 #76281

Closed

Description

@emilk

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.

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Sep 3, 2020
  2. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
    O-wasmTarget: WASM (WebAssembly), http://webassembly.org/
    and removed
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on Sep 3, 2020
  3. added a commit that references this issue on Jan 16, 2021
  4. added a commit that references this issue on Jan 16, 2021
  5. added a commit that references this issue on Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions