-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Respect -Z
unstable options in rustdoc --test
#147292
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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.
Thanks a lot! Very nice
r=me with suggestions applied in one way or another (feel free to ignore those you find unnecessarily churn-y).
LL | //! ``` | ||
| ^^^^^^^ | ||
LL | //! | ||
| ^^^ |
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.
(unrelated, preexisting) Lol, we really gotta improve the span finding heuristic for all of these cases...
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.
Yeah, the spans are really rough. I think no one realized how bad they were until now.
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.
Once -Zcrate-attr
or feature used_with_args
is stabilized, this test will break. The author that tries to stabilize any of these will then have to deal with the failures and wonder with what to replace this test or if they could even remove it.
Is there any "perma"-unstable option we could use instead or alongside -Zcrate-attr
? If you don't have the time or inclination to go look for one, could you add some kind of NOTE: If any of these options/features get stabilized, please replace with another unstable one
to both tests? Thanks, much appreciated!
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.
I quickly looked at our unstable options and nothing stand out from a quick look.
The only thing I can think of would be to emit a check-cfg warning and use -Zcheck-cfg-all-expected=yes
to show all the values in the diagnostic, but that seems quite hacky to me.
remap_path_prefix: options.remap_path_prefix.clone(), | ||
unstable_opts: options.unstable_opts.clone(), | ||
error_format: options.error_format.clone(), | ||
..config::Options::default() |
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.
I guess ideally we would either exhaustively destructure RustdocOptions
at the start of the function or exhaustively construct config::Options
to prevent such mistakes in the futures (hell, I don't even know if there are still any options we want to copy over); but yeah, it's probably not feasible due to the sheer amount of options...
89f3ae7
to
c1443e2
Compare
@bors r=fmease |
Rollup of 5 pull requests Successful merges: - #147245 (only replace the intended comma in pattern suggestions) - #147269 (Add regression test for 123953) - #147277 (Extract common logic for iterating over features) - #147292 (Respect `-Z` unstable options in `rustdoc --test`) - #147300 (Add xtensa arch to object file creation) r? `@ghost` `@rustbot` modify labels: rollup
…r=fmease Respect `-Z` unstable options in `rustdoc --test` This PR makes rustdoc respect `-Z` unstable options when collecting doctests (`rustdoc --test`). In the process I also realized that `--error-format` wasn't respected as well, making UI annotations impossible to write so I fixed that as well. Best reviewed commit by commit. Fixes rust-lang#147276 Fixes rust-lang#143930 r? fmease
Rollup of 14 pull requests Successful merges: - #142670 (Document fully-qualified syntax in `as`' keyword doc) - #144908 (Fix doctest output json) - #145685 (add CloneFromCell and Cell::get_cloned) - #146330 (Bump unicode_data and printables to version 17.0.0) - #146451 (Fix atan2 inaccuracy in documentation) - #146479 (add mem::conjure_zst) - #147190 (std: `sys::net` cleanups) - #147245 (only replace the intended comma in pattern suggestions) - #147251 (Do not assert that a change in global cache only happens when concurrent) - #147269 (Add regression test for 123953) - #147277 (Extract common logic for iterating over features) - #147280 (Return to needs-llvm-components being info-only) - #147292 (Respect `-Z` unstable options in `rustdoc --test`) - #147300 (Add xtensa arch to object file creation) r? `@ghost` `@rustbot` modify labels: rollup
…r=fmease Respect `-Z` unstable options in `rustdoc --test` This PR makes rustdoc respect `-Z` unstable options when collecting doctests (`rustdoc --test`). In the process I also realized that `--error-format` wasn't respected as well, making UI annotations impossible to write so I fixed that as well. Best reviewed commit by commit. Fixes rust-lang#147276 Fixes rust-lang#143930 r? fmease
Rollup of 5 pull requests Successful merges: - #147245 (only replace the intended comma in pattern suggestions) - #147269 (Add regression test for 123953) - #147277 (Extract common logic for iterating over features) - #147292 (Respect `-Z` unstable options in `rustdoc --test`) - #147300 (Add xtensa arch to object file creation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147292 - Urgau:rustdoc-test-unstable_opts, r=fmease Respect `-Z` unstable options in `rustdoc --test` This PR makes rustdoc respect `-Z` unstable options when collecting doctests (`rustdoc --test`). In the process I also realized that `--error-format` wasn't respected as well, making UI annotations impossible to write so I fixed that as well. Best reviewed commit by commit. Fixes #147276 Fixes #143930 r? fmease
This PR makes rustdoc respect
-Z
unstable options when collecting doctests (rustdoc --test
).In the process I also realized that
--error-format
wasn't respected as well, making UI annotations impossible to write so I fixed that as well.Best reviewed commit by commit.
Fixes #147276
Fixes #143930
r? fmease