-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: issues with some async syntax #53203
Comments
This is a bug between rustdoc and rust/src/librustc_driver/lib.rs Lines 467 to 486 in 80caa7f
However, since rustdoc manages the phases of compilation itself, this line is never hit, and thus the global state telling libsyntax what edition to use is not set. We use this call manually for building doctests (see #52385), but not anywhere else. I propose moving the |
…=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
Rustdoc seems to fail on async syntax in some situations.
With
edition = "2018"
in Cargo.toml, the following is a sample of some apparent issues.This should build fine, but fails when running rustdoc:
Tested with a few different nightlies (rustc 1.30.0-nightly (73c7873 2018-08-05)) and latest master (376b60d).
The text was updated successfully, but these errors were encountered: