Skip to content

WASM compilation broken on nightly? #53390

@jD91mZM2

Description

@jD91mZM2

A thing works fine when compiled with stable rust, but fails at runtime with nightly.

I tried this code:
https://github.com/jD91mZM2/jD91mZM2.github.io

I expected this to happen:
It'd compile and work, just like it used to.

Instead, this happened:

wasm validation error: at offset 1121: type mismatch: expression has type i32 but expected f64

It appears it has to do something with

extern {
    fn alert(string: *mut u16);
    fn log(string: *mut u16);
}

Specifically, changing them to take f64 instead fails with:

wasm validation error: at offset 2859: unused values not explicitly dropped by end of block

Meta

rustc --version --verbose:

rustc 1.30.0-nightly (67390c0c3 2018-08-14)
binary: rustc
commit-hash: 67390c0c312ca2d8649ee7aa1e4bfa823f273857
commit-date: 2018-08-14
host: x86_64-unknown-linux-gnu
release: 1.30.0-nightly
LLVM version: 7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions