Skip to content

ICE initializing tuple-struct with field initializers #4736

Closed
@brson

Description

@brson
struct NonCopyable(());

fn main() {
    let z = NonCopyable { p: () };
}
/home/brian/dev/rust/src/test/run-pass/test.rs:4:26: 4:31 error: structure has no field named `p`
/home/brian/dev/rust/src/test/run-pass/test.rs:4     let z = NonCopyable { p: () };
                                                                           ^~~~~
/home/brian/dev/rust/src/test/run-pass/test.rs:4:12: 4:23 error: missing fields: `__field__`, `__field__`
/home/brian/dev/rust/src/test/run-pass/test.rs:4     let z = NonCopyable { p: () };
                                                             ^~~~~~~~~~~
error: internal compiler error: no type for node 11: expr () (id=11) in fcx 2b8288481970

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions