Skip to content

codeaction: loop label #22692

Description

@JonasFocke01

Renaming of loop-labels seems not to work correctly for me rn. The loop-label gets not renamed in the loop itself, but the label on the loop does just fine, when invoking the codeaction from inside the loop.

rust-analyzer version: 2026-06-01

rustc version: 1.98.0-nightly (c1b22f44c 2026-06-17)

editor or extension: NeoVim; rust-analyzer installed via Mason

code snippet to reproduce:

'testlabel: for x in xes.iter() { // codeaction-rename on 'testlabel' does not rename 'testlabel' in the loop
    if x == 5 {
        continue 'testlabel; // codeaction-rename on 'testlabel' DOES rename 'testlabel' on the outer loop
    }
    println!("{x");
}

Metadata

Metadata

Labels

C-bugCategory: bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions