Skip to content

E0384 needs to be updated to new format #35184

Closed
@sophiajt

Description

@sophiajt

E0384 still uses the old format and can be updated to the new format. Ideally, we would move from span_note to span_label, as well as add a few labels.

Given the example:

fn main() {
    let x = 5;
    println!("The value of x is: {}", x);
    x = 6;
    println!("The value of x is: {}", x);
}

This would change the error from this:

error[E0384]: re-assignment of immutable variable `x`
 --> jont/varbinder.rs:4:5
  |
4 |     x = 6;
  |     ^^^^^
  |
note: prior assignment occurs here
 --> jont/varbinder.rs:2:9
  |
2 |     let x = 5;
  |         ^

to:

error[E0384]: re-assignment of immutable variable `x`
 --> jont/varbinder.rs:4:5
2 |     let x = 5;
  |         - first assignment to `x`
3 |     println!("The value of x is: {}", x);
4 |     x = 6;
  |     ^^^^^ re-assignment of immutable `x`

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