Skip to content

Rename does not affect bindings #2976

@SomeoneToIgnore

Description

@SomeoneToIgnore

This test, when added to rename.rs, does not pass:

#[test]
fn test_rename_bind_pat() {
    test_rename(
        r#"
fn main() {
    enum CustomOption<T> {
        None,
        Some(T),
    }

    let test_variable = CustomOption::Some(22);

    match test_variable {
        CustomOption::Some(foo<|>) if foo == 11 => {}
        _ => (),
    }
}"#,
        "new_name",
        r#"
fn main() {
    enum CustomOption<T> {
        None,
        Some(T),
    }

    let test_variable = CustomOption::Some(22);

    match test_variable {
        CustomOption::Some(new_name<|>) if new_name == 11 => {}
        _ => (),
    }
}"#,
    );
}

Instead, after the rename, we get the CustomOption::Some(new_name<|>) if foo == 11 => {} string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions