Skip to content

ICE that can only be reproduced on playbot/play.rust-lang.org: casting a shared reference to a *const to a *mut _ (lack of type required) #25086

Closed
@bstrie

Description

@bstrie

Test case, that mysteriously passes on my machine but fails on the playpen:

fn main() {
    &2 as *const i32 as *mut _;
}

Playpen output:

<anon>:2:5: 2:31 error: internal compiler error: cat_expr Errd
<anon>:2     &2 as *const i32 as *mut _;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:149


playpen: application terminated with error code 101
Program ended.

Local output:

ice.rs:2:5: 2:31 error: cannot determine a type for this expression: unconstrained type [E0101]
ice.rs:2     &2 as *const i32 as *mut _;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

Very strange...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions