rust-lang / rust-lang/rustc-dev-guide

In Compiler Architecture section, state explicitly you assume the compiler do not change between build

Open
#1,860 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-compiler-architecture A-incr-comp A-query-system E-medium I-confusing T-compiler
Dominant language
HTML
Stars
1.9k
Forks
612
Avg merge
17h 24m
Merged PRs (30d)
39

Description

I have been slightly confused while reading https://rustc-dev-guide.rust-lang.org/queries/incremental-compilation.html . I may or may not be the only one confused, so here is the confusion and a potential way to solve it.

Up until the section "High-level Compiler Architecture", the book was mostly about how to change the compiler. How to compile the compiler. So, while reading the part about incremental compilation, I was assuming that the compiler may change between one execution and the next one.
If it were to be the case, the whole red-green algorithm would fail, as the query DAG content would be pointless. The input could be the same while the output would still change.

In order to help future reader, I suggest adding a note, somewhere, mentioning that this entire incremental compilation is done by assuming that the same compiler is used during the previous and the current compilation.

Of course, I may be wrong. May be it still work even when you change rustc. If so, that would be a good thing to note it too

Contributor guide

No contributing guide indexed for this repository

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

Read the incremental compilation page, especially the "High-level Compiler Architecture" section, and verify whether the red-green algorithm assumes the same compiler across builds. Done means documenting that assumption there, or explaining how changed rustc versions are handled if the assumption is incorrect.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.