Skip to content

Passing &Foo for newtype struct Foo #7672

Closed
@luqmana

Description

@luqmana

It seems like this was broken as a result of the recent change to make newtypes structs immediate in certain cases.

struct TestNode(@int);

fn mm(_x: &TestNode) {}

fn main() {
    let x = &TestNode(@21);
    mm(x);
}
% rustc foo.rs
error: internal compiler error: drop_ty_immediate: non-box ty

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