-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Pass edition flags to compiler from rustdoc as expected #52385
Conversation
I'm surprised that setting the edition in the session options didn't work: Lines 214 to 233 in 3d5753f
What does this extra call do that that doesn't? Do we need to add this to our compilation runs for building docs? |
It sets the syntax parser edition. The important here being that it's done inside |
Right, but those session options are created before any parsing or compilation work is done. Either way, if it didn't work before and this makes it work, then i won't fight it. I'm just concerned that there seems to be more than one way to set the edition, and the most obvious of them doesn't work. @bors r+ rollup |
📌 Commit 65e6b2b has been approved by |
…er, r=QuietMisdreavus Pass edition flags to compiler from rustdoc as expected Fixes rust-lang#52357.
Rollup of 9 pull requests Successful merges: - #52286 (Deny bare trait objects in src/librustc_errors) - #52306 (Reduce the number of clone()s needed in obligation_forest) - #52338 (update miri) - #52385 (Pass edition flags to compiler from rustdoc as expected) - #52392 (AsRef doc wording tweaks) - #52430 (update nomicon) - #52434 (Enable incremental independent of stage) - #52435 (Calculate the exact capacity for 2 HashMaps) - #52446 (Block beta if clippy breaks.) r? @ghost
…=estebank driver: set the syntax edition in phase 1 Fixes rust-lang#53203 It seems the way libsyntax handles the desired edition is to use a global, set via `syntax_pos::hygiene::set_default_edition`. Right now, this is set in the driver in `run_compiler`, which is the entry point for running the compiler all the way through to emitting files. Since rustdoc doesn't use this function, it wasn't properly setting this global. (When initially setting up editions in rustdoc, i'd assumed that setting `sessopts.edition` would have done this... `>_>`) This was "fixed" for doctests in rust-lang#52385, but rather than patching in a call to `set_default_edition` in all the places rustdoc sets up the compiler, i've instead moved the call in the driver to be farther in the process. This means that any use of `phase_1_parse_input` with the right session options will have the edition properly set without having to also remember to set libsyntax up separately. r? @rust-lang/compiler
Fixes #52357.
r? @QuietMisdreavus