rust-lang / rust-lang/rust

Compilation/file caching consistently grows stale

Open
#139,735 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-incr-comp C-bug E-needs-mcve T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried this code:

https://github.com/jj-vcs/jj (no MRE yet, if I can figure something out, I will)

I expected to see this happen: the code to compile successfully

Instead, this happened: the code failed to compile, citing that some function calls/types are incorrect:

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> cli/src/commands/duplicate.rs:206:9
    |
206 |         duplicate_commits_onto_parents(tx.repo_mut(), &to_duplicate, &new_descs)?
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                               ---------- unexpected argument #3 of type `&std::collections::HashMap<jj_lib::backend::CommitId, std::string::String>`
    |
note: function defined here
   --> /Users/winter/src/jj/lib/src/rewrite.rs:905:8
help: remove the extra argument
    |
206 -         duplicate_commits_onto_parents(tx.repo_mut(), &to_duplicate, &new_descs)?
206 +         duplicate_commits_onto_parents(tx.repo_mut(), &to_duplicate)?

(cli and lib are two different workspace members)

However, this does actually have three arguments in the cited file -- the previous revision that I changed my working copy to had two arguments, but rustc doesn't register that for some reason:

pub fn duplicate_commits_onto_parents(
    mut_repo: &mut MutableRepo,
    target_commits: &[CommitId],
    target_descriptions: &HashMap<CommitId, String>,
) -> BackendResult<DuplicateCommitsStats>

The mtime of the file in question is sane:

-rw-r--r-- 1 winter staff 44K Apr 12 23:25 /Users/winter/src/jj/lib/src/rewrite.rs

The only way to work around this is to nuke target/, which is obviously quite annoying.

Meta

rustc --version --verbose:

rustc 1.88.0-nightly (934880f58 2025-04-09)
binary: rustc
commit-hash: 934880f586f6ac1f952c7090e2a943fcd7775e7b
commit-date: 2025-04-09
host: aarch64-apple-darwin
release: 1.88.0-nightly
LLVM version: 20.1.2
Backtrace

n/a, no backtrace was printed

Note: incremental compilation is disabled with CARGO_INCREMENTAL=0.

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.

Research direction

Start by reproducing the stale compilation behavior in the jj workspace, focusing on the cli/src/commands/duplicate.rs call and lib/src/rewrite.rs definition. Compare builds with and without the target/ directory and with CARGO_INCREMENTAL=0, then determine what makes rustc use the outdated two-argument signature. Done means the reported workspace change compiles without manually deleting target/.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.