Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of driver cleanups #93936

Merged
merged 3 commits into from
Feb 13, 2022
Merged

Couple of driver cleanups #93936

merged 3 commits into from
Feb 13, 2022

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Feb 12, 2022

  • Remove the RustcDefaultCalls struct, which hasn't been necessary since the introduction of rustc_interface.
  • Move the setup_callbacks call around for a tiny code deduplication.
  • Remove the SPAN_DEBUG global as it isn't actually necessary.

It is a leftover from before the introduction of rustc_interface
This ensures that it is called even when run_in_thread_pool_with_globals
is avoided and reduces code duplication between the parallel and
non-parallel version of run_in_thread_pool_with_globals
The only difference between the default and rustc_interface set version
is that the default accesses the source map from SESSION_GLOBALS while
the rustc_interface version accesses the source map from the global
TyCtxt. SESSION_GLOBALS is always set while running the compiler while
the global TyCtxt is not always set. If the global TyCtxt is set, it's
source map is identical to the one in SESSION_GLOBALS
@bjorn3 bjorn3 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 12, 2022
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 12, 2022
@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 12, 2022
@bjorn3 bjorn3 mentioned this pull request Feb 12, 2022
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 12, 2022

📌 Commit f45ba82 has been approved by cjgillot

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 12, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2022
…askrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#89926 (make `Instant::{duration_since, elapsed, sub}` saturating and remove workarounds)
 - rust-lang#90532 (More informative error message for E0015)
 - rust-lang#93810 (Improve chalk integration)
 - rust-lang#93851 (More practical examples for `Option::and_then` & `Result::and_then`)
 - rust-lang#93885 (bootstrap.py: Suggest disabling download-ci-llvm option if url fails to download)
 - rust-lang#93886 (Stabilise inherent_ascii_escape (FCP in rust-lang#77174))
 - rust-lang#93930 (add link to format_args! when mention it in docs)
 - rust-lang#93936 (Couple of driver cleanups)
 - rust-lang#93944 (Don't relabel to a team if there is already a team label)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dff7d51 into rust-lang:master Feb 13, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 13, 2022
@bjorn3 bjorn3 deleted the simplifications2 branch February 13, 2022 10:51
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2022
Remove Config::stderr

1. It captured stdout and not stderr
2. It isn't used anywhere
3. All error messages should go to the DiagnosticOutput instead
4. It modifies thread local state

Marking as blocked as it will conflict a bit with rust-lang#93936.
nnethercote added a commit to nnethercote/rust that referenced this pull request Mar 31, 2023
Rename `with_source_map` as `set_source_map`. Because `with` functions
(e.g. `with_session_globals`, `scoped_tls::ScopedKey::with`) are for
*getting* a value for the duration of a closure, and `set` functions
(e.g. `set_session_globals_then` `scoped_tls::ScopedKey::with`) are for
*setting* a value for the duration of a closure.

Also fix up the comment, which is wrong:
- The bit about `TyCtxt` is wrong.
- `span_debug1` doesn't exist any more.
- There's only one level of fallback, not two.

(This is effectively a follow-up to the changes in rust-lang#93936.)

Also add a comment explaining that `SessionGlobals::source_map` should
only be used when absolutely necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants