-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Move SourceMap
initialization
#122811
Move SourceMap
initialization
#122811
Conversation
These commits modify compiler targets. Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This is a follow-up to #122810, and the first two commits come from that PR. I've put this in a separate PR so we can merge the removal of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly looks good. I have a couple comments, but we'll have to wait for #122811 to merge first anyway.
668e70e
to
53aba67
Compare
I have updated and addressed the comments. I think this shouldn't land quite yet, to give a little more time for any fallout from #122810 to happen. I will be around on Monday but then I will be on vacation for three weeks. Maybe this should wait until I get back, just to be safe. |
r=me whenever you feel like we waited enough :) |
☔ The latest upstream changes (presumably #115220) made this pull request unmergeable. Please resolve the merge conflicts. |
Replacing `mk_session` with `sess_and_cfgs`, which does a bit more of the shared stuff -- the option parsing and the `build_configuration` call.
Currently `SourceMap` is constructed slightly later than `SessionGlobals`, and inserted. This commit changes things so they are done at the same time. Benefits: - `SessionGlobals::source_map` changes from `Lock<Option<Lrc<SourceMap>>>` to `Option<Lrc<SourceMap>>`. It's still optional, but mutability isn't required because it's initialized at construction. - `set_source_map` is removed, simplifying `run_compiler`, which is good because that's a critical function and it's nice to make it simpler. This requires moving things around a bit, so the necessary inputs are available when `SessionGlobals` is created, in particular the `loader` and `hash_kind`, which are no longer computed by `build_session`. These inputs are captured by the new `SourceMapInputs` type, which is threaded through various places.
Currently it's a method on `EarlyDiagCtxt`, which is not the right place for it at all -- `EarlyDiagCtxt` is used to issue diagnostics, but shouldn't be doing any of the actual checking. This commit moves it into a standalone function that takes an `EarlyDiagCtxt` as an argument, which is more sensible. This does require adding `EarlyDiagCtxt::early_struct_warn`, so a warning can be returned and then modified with a note. (And that likely explains why somebody put `initialize_checked_jobserver` into `EarlyDiagCtxt` in the first place.)
53aba67
to
9b0ced0
Compare
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#122811 (Move `SourceMap` initialization) - rust-lang#123512 (Match ergonomics 2024: Implement eat-one-layer) - rust-lang#123811 (Use queue-based `RwLock` on more platforms) - rust-lang#123859 (Remove uneeded clones now that TrustedStep implies Copy) - rust-lang#123979 (Subtype predicates only exist on inference types, so we can allow them to register opaque types within them.) - rust-lang#124016 (Outline default query and hook provider function implementations) - rust-lang#124023 (Allow workproducts without object files.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122811 - nnethercote:mv-SourceMap-init, r=WaffleLapkin Move `SourceMap` initialization So it happens at the same time as `SessionGlobals` initialization, rather than shortly afterward. r? `@WaffleLapkin`
…affleLapkin Move `SourceMap` initialization So it happens at the same time as `SessionGlobals` initialization, rather than shortly afterward. r? `@WaffleLapkin`
So it happens at the same time as
SessionGlobals
initialization, rather than shortly afterward.r? @WaffleLapkin