Skip to content

"rewriting static" (the words) forcibly inserted at top of file on save #17486

Closed
rust-lang/rust
#126888
@dream-dasher

Description

"This is a serious regression in nightly and it's important to fix it before the next release."

The words "rewriting static" are forcibly inserted at the top of my main.rs file. (please see two attached gifs, using different editors [zed & helix])

It's quite late for me, so I haven't had been able to delve into what triggers the behavior. (It's happening in my main.rs, but not lib.rs, for example). Below is some information to start though. Let me know what might be helpful to see from me if if anything.

  • Cause: installing install rustup nightly presently (re)causes the issue
    • (nightly-aarch64-apple-darwin unchanged - rustc 1.81.0-nightly (bcf94dec5 2024-06-23))
  • Fix: installing rustup install nightly-2024-06-20 (and setting to same in rust-toolchain.toml) removes the issue
    • ( nightly-2024-06-20-aarch64-apple-darwin installed - rustc 1.81.0-nightly (d8a38b000 2024-06-19)

In both cases rust-analyzer --version returns:

  • rust-analyzer 1.79.0 (129f3b99 2024-06-10)
    (I'm not sure if I'm calling this incorrectly or rust-analyzer isn't alone the culprit and instead an interaction with the compiler. (or something in the compiler besides rust-analyzer can trigger code insertion)

rust_analyzer_bug_zedexample

rust_analyzer_bug_helixexample

Metadata

Assignees

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