Skip to content

ICE trying to deref a newtype struct implementing Drop #5451

Closed
@ben0x539

Description

@ben0x539
struct S(int);

impl Drop for S {
    fn finalize(&self) {}
}

fn main() {
    *S(42);
}

$ RUST_LOG=rustc=1,::rt::backtrace rustc newtype_ice.rs
rust: ~"invoke at newtype_ice.rs:8:5: 8:11"
rust: task failed at 'assertion failed: adt::is_newtypeish(repr)', /home/ben/code/repos/rust/src/librustc/middle/trans/datum.rs:722
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions