-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Hide unstable print kinds within emit_unknown_print_request_help in stable channel #139850
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
rustbot has assigned @petrochenkov. Use |
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.
Can you add a functional test for this change? In the test, I'd also like to see exercised:
- Single stable print flag vs single unstable print flag
- Mixed unstable/stable print flag
Sure no problem, but I would like to know how to add functional tests, is it done locally to me? |
As in, a ui test e.g. https://rustc-dev-guide.rust-lang.org/tests/adding.html |
Ooh, I have no idea to control the channel, e.g. nightly or stable, in the ui test. It may be like
or
or
But they are failed. Do you have any suggestion? |
What you can do for the purpose of this test ( //@ revisions: force_stable force_unstable
//@[force_stable] rustc-env: RUSTC_BOOTSTRAP=-1
//@[force_unstable] rustc-env: RUSTC_BOOTSTRAP=1 |
It works, but it passes unstable flags
and report
How to turn off the flags? By the way, would it be better to write it to rustc_develop_guide, I didn't find this in the documentation. |
Oh right I forgor about the ui test preset flags. In this case, can you use a run-make test instead, since you want to explicitly control and constrain the exact compiler flags you want to pass. |
|
This PR modifies cc @jieyouxu |
I've added a run-make test for current PR, and a few more that may help later with changes to the relevant topic. So I named it |
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, some more nits
Can you call it sth like "print-request-help-stable-unstable" instead (see the review comments above regarding redundant tests)? |
Thank you, I revised it. : ) @jieyouxu |
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.
Looks good for the most part, some suggestions
I updated it. 😊 |
BTW you can mark PR as ready for review with |
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, can you squash the commits into one?
…table channel Signed-off-by: xizheyin <[email protected]>
Ok, so that's how you review. @rustbot review |
Ah yeah, triagebot would print that help message about @rustbot author |
Reminder, once the PR becomes ready for a review, use |
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
@bors r+ rollup |
Hide unstable print kinds within emit_unknown_print_request_help in stable channel Fixes rust-lang#138698 We need to get the channel from `matches`. However, since `matches`(Line 1169) is constructed after `rustc_optgroups` (Line1165, where `RustcOptGroup::value_hint` is generated, i.e. what `rustc --print print` prints), I've left it unchanged here for now. https://github.com/rust-lang/rust/blob/2da29dbe8fe23df1c7c4ab1d8740ca3c32b15526/compiler/rustc_driver_impl/src/lib.rs#L1161-L1169 There is actually a way to manually parse the `--crate-name` parameter, but I'm afraid that's an unorthodox practice. So I conservatively just modified `emit_unknown_print_request_help` to print different parameters depending on whether they are nightly or not when passing the error parameter. r? `@jieyouxu`
Hide unstable print kinds within emit_unknown_print_request_help in stable channel Fixes rust-lang#138698 We need to get the channel from `matches`. However, since `matches`(Line 1169) is constructed after `rustc_optgroups` (Line1165, where `RustcOptGroup::value_hint` is generated, i.e. what `rustc --print print` prints), I've left it unchanged here for now. https://github.com/rust-lang/rust/blob/2da29dbe8fe23df1c7c4ab1d8740ca3c32b15526/compiler/rustc_driver_impl/src/lib.rs#L1161-L1169 There is actually a way to manually parse the `--crate-name` parameter, but I'm afraid that's an unorthodox practice. So I conservatively just modified `emit_unknown_print_request_help` to print different parameters depending on whether they are nightly or not when passing the error parameter. r? ``@jieyouxu``
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#139774 (Fix replacing supertrait aliases in `ReplaceProjectionWith`) - rust-lang#139850 (Hide unstable print kinds within emit_unknown_print_request_help in stable channel) - rust-lang#139870 (add retries to remove and create dir all) - rust-lang#139902 (do not emit `OpaqueCast` projections with `-Znext-solver`) - rust-lang#139931 (bootstrap: enable zlib for LLVM for Windows GNU) - rust-lang#139935 (Upgrade to `rustc-rayon-core` 0.5.1) - rust-lang#139943 (rustdoc: Support inlined cross-crate re-exported trait aliases) - rust-lang#139961 (Two `rustc_const_eval` cleanups) - rust-lang#139962 (opt-dist: add a flag for running tests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139850 - xizheyin:issue-138698, r=jieyouxu Hide unstable print kinds within emit_unknown_print_request_help in stable channel Fixes rust-lang#138698 We need to get the channel from `matches`. However, since `matches`(Line 1169) is constructed after `rustc_optgroups` (Line1165, where `RustcOptGroup::value_hint` is generated, i.e. what `rustc --print print` prints), I've left it unchanged here for now. https://github.com/rust-lang/rust/blob/2da29dbe8fe23df1c7c4ab1d8740ca3c32b15526/compiler/rustc_driver_impl/src/lib.rs#L1161-L1169 There is actually a way to manually parse the `--crate-name` parameter, but I'm afraid that's an unorthodox practice. So I conservatively just modified `emit_unknown_print_request_help` to print different parameters depending on whether they are nightly or not when passing the error parameter. r? ```@jieyouxu```
Fixes #138698
We need to get the channel from
matches
. However, sincematches
(Line 1169) is constructed afterrustc_optgroups
(Line1165, whereRustcOptGroup::value_hint
is generated, i.e. whatrustc --print print
prints), I've left it unchanged here for now.rust/compiler/rustc_driver_impl/src/lib.rs
Lines 1161 to 1169 in 2da29db
There is actually a way to manually parse the
--crate-name
parameter, but I'm afraid that's an unorthodox practice. So I conservatively just modifiedemit_unknown_print_request_help
to print different parameters depending on whether they are nightly or not when passing the error parameter.r? @jieyouxu