Skip to content

driver: set the syntax edition in phase 1 - #53226

Merged
bors merged 1 commit into
rust-lang:masterfrom
QuietMisdreavus:editions-for-all
Aug 14, 2018
Merged

driver: set the syntax edition in phase 1#53226
bors merged 1 commit into
rust-lang:masterfrom
QuietMisdreavus:editions-for-all

Conversation

@QuietMisdreavus

Copy link
Copy Markdown
Contributor

Fixes#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 #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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 9, 2018
@petrochenkovpetrochenkov self-assigned this Aug 9, 2018
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 9, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 0511b01 has been approved by estebank

@borsbors 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 Aug 9, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Aug 14, 2018
…=estebank
driver: set the syntax edition in phase 1
Fixesrust-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
@kennytmkennytm mentioned this pull request Aug 14, 2018
bors added a commit that referenced this pull request Aug 14, 2018
Rollup of 11 pull requests
Successful merges:
- #53112 (pretty print BTreeSet)
- #53208 (Don't panic on std::env::vars() when env is null.)
- #53226 (driver: set the syntax edition in phase 1)
- #53229 (Make sure rlimit is only ever increased)
- #53233 (targets: aarch64: Add bare-metal aarch64 target)
- #53239 (rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.)
- #53246 (A few cleanups)
- #53257 (Idiomatic improvements to IP method)
- #53274 (Remove statics field from CodegenCx)
- #53290 (Make LLVM emit assembly comments with -Z asm-comments)
- #53317 (Mark prior failure to avoid ICE)
@bors
bors merged commit 0511b01 into rust-lang:masterAug 14, 2018
@QuietMisdreavus
QuietMisdreavus deleted the editions-for-all branch August 15, 2018 01:14
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc: issues with some async syntax

5 participants

@QuietMisdreavus@estebank@bors@petrochenkov@rust-highfive