Skip to content

diverging function with wrapped diverging tail expression regression #35849

Closed
@Dushistov

Description

@Dushistov

Such code:

#[allow(dead_code)]
fn _assert_pointers_are_64bits() -> ! {
    unsafe {
        ::std::mem::transmute::<*const f64, [u8; 8]>(panic!())
    }
}

fn main() {
}

compiled just fine with stable(1.11.0 (9b21dcd 2016-08-15)),
but failed with beta(rustc 1.12.0-beta.1 (822166b 2016-08-16)) and
nightly(rustc 1.13.0-nightly (499484f 2016-08-18)) with such error:

error[E0308]: mismatched types
 --> bug.rs:4:9
  |
4 |         ::std::mem::transmute::<*const f64, [u8; 8]>(panic!())
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array of 8 elements
  |
  = note: expected type `!`
  = note:    found type `[u8; 8]`

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions