-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Rollup of 6 pull requests #102880
Rollup of 6 pull requests #102880
Commits on Oct 7, 2022
-
rustc's startup has several layers, including: - `interface::run_compiler` passes a closure, `f`, to `run_in_thread_pool_with_globals`, which creates a thread pool, sets up session globals, and passes `f` to `create_compiler_and_run`. - `create_compiler_and_run` creates a `Session`, a `Compiler`, sets the source map, and calls `f`. rustdoc is a bit different. - `main_args` calls `main_options` via `run_in_thread_pool_with_globals`, which (again) creates a thread pool (hardcoded to a single thread!) and sets up session globals. - `main_options` has four different paths. - The second one calls `interface::run_compiler`, which redoes the `run_in_thread_pool_with_globals`! This is bad. - The fourth one calls `interface::create_compiler_and_run`, which is reasonable. - The first and third ones don't do anything of note involving the above functions, except for some symbol interning which requires session globals. In other words, rustdoc calls into `rustc_interface` at three different levels. It's a bit confused, and feels like code where functionality has been added by different people at different times without fully understanding how the globally accessible stuff is set up. This commit tidies things up. It removes the `run_in_thread_pool_with_globals` call in `main_args`, and adjust the four paths in `main_options` as follows. - `markdown::test` calls `test::test_main`, which provides its own parallelism and so doesn't need a thread pool. It had one small use of symbol interning, which required session globals, but the commit removes this. - `doctest::run` already calls `interface::run_compiler`, so it doesn't need further adjustment. - `markdown::render` is simple but needs session globals for interning (which can't easily be removed), so it's now wrapped in `create_session_globals_then`. - The fourth path now uses `interface::run_compiler`, which is equivalent to the old `run_in_thread_pool_with_globals` + `create_compiler_and_run` pairing.
Configuration menu - View commit details
-
Copy full SHA for bf135de - Browse repository at this point
Copy the full SHA bf135deView commit details -
Merge
main_options
intomain_args
.There is no longer any need for them to be separate.
Configuration menu - View commit details
-
Copy full SHA for c461f3a - Browse repository at this point
Copy the full SHA c461f3aView commit details -
Inline and remove
scoped_thread
.It has a single call site, and removing it slightly improves the confusing tangle of nested closures present at startup.
Configuration menu - View commit details
-
Copy full SHA for d156a90 - Browse repository at this point
Copy the full SHA d156a90View commit details -
Configuration menu - View commit details
-
Copy full SHA for 226387a - Browse repository at this point
Copy the full SHA 226387aView commit details -
Inline and remove
create_compiler_and_run
.It has a single call site.
Configuration menu - View commit details
-
Copy full SHA for c00937f - Browse repository at this point
Copy the full SHA c00937fView commit details -
Apply
Lrc
later tosess
andcodegen_backend
.This avoids the need for a degenerate `Lrc::get_mut` call.
Configuration menu - View commit details
-
Copy full SHA for 8067016 - Browse repository at this point
Copy the full SHA 8067016View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f0463a - Browse repository at this point
Copy the full SHA 1f0463aView commit details
Commits on Oct 10, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 0571b0a - Browse repository at this point
Copy the full SHA 0571b0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6934853 - Browse repository at this point
Copy the full SHA 6934853View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1c159f - Browse repository at this point
Copy the full SHA c1c159fView commit details -
rustdoc: clean up overly complex
.trait-impl
CSS selectorsWhen added in 4596436, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.
Configuration menu - View commit details
-
Copy full SHA for 03fe005 - Browse repository at this point
Copy the full SHA 03fe005View commit details -
let
is not allowed in struct field definitionsCo-authored-by: jyn514 <[email protected]> Co-authored-by: Esteban Kuber <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6071b4b - Browse repository at this point
Copy the full SHA 6071b4bView commit details -
Rollup merge of rust-lang#101360 - compiler-errors:multiple-closure-b…
…ounds, r=petrochenkov Point out incompatible closure bounds Fixes rust-lang#100295
Configuration menu - View commit details
-
Copy full SHA for b5a59cf - Browse repository at this point
Copy the full SHA b5a59cfView commit details -
Rollup merge of rust-lang#101789 - gimbles:let, r=estebank
`let`'s not needed in struct field definitions Fixes rust-lang#101683
Configuration menu - View commit details
-
Copy full SHA for 8d606ef - Browse repository at this point
Copy the full SHA 8d606efView commit details -
Rollup merge of rust-lang#102769 - nnethercote:rustdoc-startup, r=jyn514
Clean up rustdoc startup Startup is pretty hairy, in both rustdoc and rustc. The first commit here improves the rustdoc situation quite a bit. The remaining commits are smaller but also help. Best reviewed one commit at a time. r? `@jyn514`
Configuration menu - View commit details
-
Copy full SHA for 133e945 - Browse repository at this point
Copy the full SHA 133e945View commit details -
Rollup merge of rust-lang#102830 - compiler-errors:constness-parity, …
…r=fee1-dead Unify `tcx.constness` query and param env constness checks The checks that we do in the `constness` query seem inconsistent with the checks that we do to determine if an item's param-env is const, so I merged them into the `constness` query and call that from the `param_env` query. I'm not sure if this totally makes sense -- is there a case where `tcx.param_env()` would return a const param-env for an item whose `tcx.constness()` is `Constness::NotConst`? Because if not, it seems a bit dangerous that these two differ. Luckily, not many places actually use `tcx.constness()`, and the checks in `tcx.param_env()` seem stricter than the checks in `tcx.constness()` (at least for the types of items we type-check). Also, due to the way that `tcx.param_env()` is implemented, it _never_ used to return a const param-env for a item coming from a different crate, which also seems dangerous (though also probably not weaponizable currently, because we seldom actually compute the param-env for a non-local item).
Configuration menu - View commit details
-
Copy full SHA for 56be8ab - Browse repository at this point
Copy the full SHA 56be8abView commit details -
Rollup merge of rust-lang#102871 - notriddle:notriddle/trait-impl-anc…
…hor, r=GuillaumeGomez rustdoc: clean up overly complex `.trait-impl` CSS selectors When added in 4596436, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.
Configuration menu - View commit details
-
Copy full SHA for 0492622 - Browse repository at this point
Copy the full SHA 0492622View commit details -
Rollup merge of rust-lang#102876 - SparrowLii:import-candidate, r=fee…
…1-dead suggest candidates for unresolved import Currently we prompt suggestion of candidates(help notes of `use xxx::yyy`) for names which cannot be resolved, but we don't do that for import statements themselves that couldn't be resolved. It seems reasonable to add candidate help information for these statements as well. Fixes rust-lang#102711
Configuration menu - View commit details
-
Copy full SHA for a7a8c70 - Browse repository at this point
Copy the full SHA a7a8c70View commit details