Skip to content

ICE on nightly 2017-11-07: casting *const i64 to *mut _ #45872

Closed
@jeehoonkang

Description

@jeehoonkang
  • meta

    $ rustc --version
    rustc 1.23.0-nightly (ee2286149 2017-11-07)
    
    $ uname -a
    Darwin Jeehoon-Kangs-MacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
    
  • minimal example: https://play.rust-lang.org/?gist=231bf59b18642fcaba9a939dd43c41d8&version=nightly

    use std::ptr;
    
    fn main() {
        let p1: *const i64 = ptr::null();
        let p2 = p1 as *mut _;
    }
  • error message (from playground)

       Compiling playground v0.0.1 (file:///playground)
    error: internal compiler error: unexpected panic
    
    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: rustc 1.23.0-nightly (ee2286149 2017-11-07) running on x86_64-unknown-linux-gnu
    
    thread 'rustc' panicked at 'explicit panic', /checkout/src/librustc_typeck/check/cast.rs:108:17
    note: Run with `RUST_BACKTRACE=1` for a backtrace.
    
    error: Could not compile `playground`.
    
    To learn more, run the command again with --verbose.
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions