Skip to content

E0205 needs to be updated to new format #35382

Closed
@sophiajt

Description

@sophiajt

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

Error E0205 needs a span label and updated title, changing it from:

error[E0205]: the trait `Copy` may not be implemented for this type; variant `Bar` does not implement `Copy`
  --> src/test/compile-fail/E0205.rs:18:10
   |
18 | #[derive(Copy)] //~ ERROR E0205
   |          ^^^^
src/test/compile-fail/E0205.rs:18:10: 18:14 note: in this expansion of #[derive(Copy)] (defined in src/test/compile-fail/E0205.rs)

error[E0205]: the trait `Copy` may not be implemented for this type; variant `Bar` does not implement `Copy`
  --> src/test/compile-fail/E0205.rs:16:1
   |
16 | impl Copy for Foo { } //~ ERROR E0205
   | ^^^^^^^^^^^^^^^^^^^^^

to:

error[E0205]: the trait `Copy` may not be implemented for this type
  --> src/test/compile-fail/E0205.rs:18:10
   |
18 | #[derive(Copy)] //~ ERROR E0205
   |          ^^^^ variant `Bar` does not implement `Copy`
src/test/compile-fail/E0205.rs:18:10: 18:14 note: in this expansion of #[derive(Copy)] (defined in src/test/compile-fail/E0205.rs)

error[E0205]: the trait `Copy` may not be implemented for this type
  --> src/test/compile-fail/E0205.rs:16:1
   |
16 | impl Copy for Foo { } //~ ERROR E0205
   | ^^^^^^^^^^^^^^^^^^^^^ variant `Bar` does not implement `Copy`

Bonus: the span for the second one could be shrunk to just the Copy part:

error[E0205]: the trait `Copy` may not be implemented for this type
  --> src/test/compile-fail/E0205.rs:18:10
   |
18 | #[derive(Copy)] //~ ERROR E0205
   |          ^^^^ variant `Bar` does not implement `Copy`
src/test/compile-fail/E0205.rs:18:10: 18:14 note: in this expansion of #[derive(Copy)] (defined in src/test/compile-fail/E0205.rs)

error[E0205]: the trait `Copy` may not be implemented for this type
  --> src/test/compile-fail/E0205.rs:16:1
   |
16 | impl Copy for Foo { } //~ ERROR E0205
   |      ^^^^ variant `Bar` does not implement `Copy`

Note: I'm not sure the "expansion of..." part is helpful, you could also remove that.

Seems related to #35381

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.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions