Skip to content

Split IncrCompSession out of Session#159225

Draft
bjorn3 wants to merge 4 commits into
rust-lang:mainfrom
bjorn3:split_incr_comp_session
Draft

Split IncrCompSession out of Session#159225
bjorn3 wants to merge 4 commits into
rust-lang:mainfrom
bjorn3:split_incr_comp_session

Conversation

@bjorn3

@bjorn3 bjorn3 commented Jul 13, 2026

Copy link
Copy Markdown
Member

This will allow introducing a separate incr comp session dir for the post LTO artifacts in the future. In addition it statically encodes the lifetime of the incr comp session rather than requiring an enum behind a mutex stored in the Session.

Based on #159000

bjorn3 added 4 commits July 8, 2026 19:45
Previously we would still try to rename the incr comp session dir after
deleting it.
In both cases the incr comp session dir should no longer be accessed.
This will allow introducing a separate incr comp session dir for the
post LTO artifacts in the future. In addition it statically encodes the
lifetime of the incr comp session rather than requiring an enum behind a
mutex stored in the Session.
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 13, 2026
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, incremental
  • compiler, incremental expanded to 75 candidates
  • Random selection from 18 candidates

@bjorn3 bjorn3 marked this pull request as draft July 13, 2026 13:52
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2026
@bjorn3 bjorn3 added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jul 13, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error[E0308]: mismatched types
   --> src/librustdoc/doctest.rs:262:9
    |
261 |     } = match result {
    |               ------ this expression has type `(Result<Option<CreateRunnableDocTests>, String>, Option<...>)`
262 |         Ok(Some(collector)) => collector,
    |         ^^^^^^^^^^^^^^^^^^^ expected `(Result<Option<...>, ...>, ...)`, found `Result<_, _>`
    |
    = note: expected tuple `(std::result::Result<std::option::Option<CreateRunnableDocTests>, std::string::String>, std::option::Option<IncrCompSession>)`
                found enum `std::result::Result<_, _>`
    = note: the full name for the type has been written to '/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/build/rustdoc/e2ade74941381a74/out/rustdoc-e2ade74941381a74.long-type-5211659539069302315.txt'
    = note: consider using `--verbose` to print the full type name to the console

error[E0308]: mismatched types
   --> src/librustdoc/doctest.rs:263:9
    |
261 |     } = match result {
    |               ------ this expression has type `(Result<Option<CreateRunnableDocTests>, String>, Option<...>)`
262 |         Ok(Some(collector)) => collector,
263 |         Ok(None) => return,
    |         ^^^^^^^^ expected `(Result<Option<...>, ...>, ...)`, found `Result<_, _>`
    |
    = note: expected tuple `(std::result::Result<std::option::Option<CreateRunnableDocTests>, std::string::String>, std::option::Option<IncrCompSession>)`
                found enum `std::result::Result<_, _>`
    = note: the full name for the type has been written to '/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/build/rustdoc/e2ade74941381a74/out/rustdoc-e2ade74941381a74.long-type-5211659539069302315.txt'
    = note: consider using `--verbose` to print the full type name to the console

error[E0308]: mismatched types
   --> src/librustdoc/doctest.rs:264:9
    |
261 |     } = match result {
    |               ------ this expression has type `(Result<Option<CreateRunnableDocTests>, String>, Option<...>)`
...
264 |         Err(error) => {
    |         ^^^^^^^^^^ expected `(Result<Option<...>, ...>, ...)`, found `Result<_, _>`
    |
    = note: expected tuple `(std::result::Result<std::option::Option<CreateRunnableDocTests>, std::string::String>, std::option::Option<IncrCompSession>)`
                found enum `std::result::Result<_, _>`
    = note: the full name for the type has been written to '/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/build/rustdoc/e2ade74941381a74/out/rustdoc-e2ade74941381a74.long-type-5211659539069302315.txt'
    = note: consider using `--verbose` to print the full type name to the console

error[E0277]: the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `FromResidual`)
   --> src/librustdoc/lib.rs:858:27
    |
852 |                 interface::run_compiler(config, |compiler| {
    |                                                 ---------- this function should return `Result` or `Option` to accept `?`
...
858 |                         })?;
    |                           ^ cannot use the `?` operator in a closure that returns `(std::result::Result<(), _>, std::option::Option<IncrCompSession>)`

error[E0308]: mismatched types
   --> src/librustdoc/lib.rs:852:17
    |
850 |               return wrap_return(
    |                      ----------- arguments to this function are incorrect
851 |                   dcx,
852 | /                 interface::run_compiler(config, |compiler| {
853 | |                     // construct a phony "crate" without actually running the parser
854 | |                     // allows us to use other compiler infrastructure like dep-info
855 | |                     let file =
...   |
886 | |                     })
887 | |                 }),
    | |__________________^ expected `Result<(), String>`, found `(Result<(), _>, Option<IncrCompSession>)`
    |
    = note: expected enum `std::result::Result<(), std::string::String>`
              found tuple `(std::result::Result<(), _>, std::option::Option<IncrCompSession>)`
note: function defined here
   --> src/librustdoc/lib.rs:720:15
    |
720 | pub(crate) fn wrap_return(dcx: DiagCtxtHandle<'_>, res: Result<(), String>) {
    |               ^^^^^^^^^^^                          -----------------------

error[E0308]: mismatched types
   --> src/librustdoc/lib.rs:930:9
    |
930 | /         rustc_interface::create_and_enter_global_ctxt(compiler, krate, |tcx| {
931 | |             if sess.dcx().has_errors().is_some() {
932 | |                 sess.dcx().fatal("Compilation failed, aborting rustdoc");
...   |
995 | |         })
    | |          ^- help: consider using a semicolon here: `;`
    | |__________|
    |            expected `()`, found `((), Option<IncrCompSession>)`
    |
    = note: expected unit type `()`
                   found tuple `((), std::option::Option<IncrCompSession>)`
note: return type inferred to be `()` here
   --> src/librustdoc/lib.rs:926:13
    |
926 |             return;
    |             ^^^^^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants