Skip to content

E0450 needs to be updated to new format #35925

Closed
@sophiajt

Description

@sophiajt

From: src/test/compile-fail/E0450.rs

E0450 needs a span_label, updating it from:

error[E0450]: cannot invoke tuple struct constructor with private fields
  --> src/test/compile-fail/E0450.rs:16:13
   |
16 |     let f = Bar::Foo(0); //~ ERROR E0450
   |             ^^^^^^^^

To:

error[E0450]: cannot invoke tuple struct constructor with private fields
  --> src/test/compile-fail/E0450.rs:16:13
   |
16 |     let f = Bar::Foo(0); //~ ERROR E0450
   |             ^^^^^^^^ cannot construct with a private field

Bonus: add a label to where the private field comes from:

error[E0450]: cannot invoke tuple struct constructor with private fields
  --> src/test/compile-fail/E0450.rs:16:13
   |
12 |     pub struct Foo(isize);
   |                    ----- private field declared here
...
16 |     let f = Bar::Foo(0); //~ ERROR E0450
   |             ^^^^^^^^ cannot construct with a private field

Alternatively, if underlining the private field is too tricky, just underline the whole tuple constructor definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions