rust-lang / rust-lang/rust-analyzer

codeaction: loop label

Open
#22,692 8 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

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");
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.