Skip to content

Handle no values cfgs with --print=check-cfg - #125818

Merged
bors merged 2 commits into
rust-lang:masterfrom
Urgau:print-check-cfg-no-values
Jun 4, 2024
Merged

Handle no values cfgs with --print=check-cfg#125818
bors merged 2 commits into
rust-lang:masterfrom
Urgau:print-check-cfg-no-values

Conversation

@Urgau

@UrgauUrgau commented May 31, 2024

Copy link
Copy Markdown
Member

This PR fix a bug with --print=check-cfg, where no values cfgs where not printed since we only printed cfgs that had at least one values.

The representation I choose is CFG=, since it doesn't correspond to any valid config, it also IMO nicely complements the values() part of --check-cfg (to indicate no values). Representing the absence of value by the absence of value.

So for cfg(feature, values()) we would print feature=.

I also added the missing tracking issue number in the doc.

r? @petrochenkov

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 31, 2024
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in run-make tests.

cc @jieyouxu

Comment threadtests/run-make/print-check-cfg/rmake.rs Outdated
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? `@jieyouxu`
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? ``@jieyouxu``
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? ```@jieyouxu```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? ````@jieyouxu````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? `````@jieyouxu`````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? ``````@jieyouxu``````
fmease added a commit to fmease/rust that referenced this pull request Jun 1, 2024
…t, r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? ```````@jieyouxu```````
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 2, 2024
… r=jieyouxu
Refactor `--print=check-cfg` test
*as asked in rust-lang#125818 (comment)
r? `@jieyouxu`
@bors

This comment was marked as resolved.

@Urgau
Urgauforce-pushed the print-check-cfg-no-values branch from 2a4c6b3 to f58bf91CompareJune 2, 2024 09:49
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Jun 3, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit f58bf91 has been approved by petrochenkov

It is now in the queue for this repository.

@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 Jun 3, 2024
Noratrieb added a commit to Noratrieb/rust that referenced this pull request Jun 4, 2024
…=petrochenkov
Handle no values cfgs with `--print=check-cfg`
This PR fix a bug with `--print=check-cfg`, where no values cfgs where not printed since we only printed cfgs that had at least one values.
The representation I choose is `CFG=`, since it doesn't correspond to any valid config, it also IMO nicely complements the `values()` (to indicate no values). Representing the absence of value by the absence of the value.
So for `cfg(feature, values())` we would print `feature=`.
I also added the missing tracking issue number in the doc.
r? `@petrochenkov`
@NoratriebNoratrieb mentioned this pull request Jun 4, 2024
Noratrieb added a commit to Noratrieb/rust that referenced this pull request Jun 4, 2024
…=petrochenkov
Handle no values cfgs with `--print=check-cfg`
This PR fix a bug with `--print=check-cfg`, where no values cfgs where not printed since we only printed cfgs that had at least one values.
The representation I choose is `CFG=`, since it doesn't correspond to any valid config, it also IMO nicely complements the `values()` (to indicate no values). Representing the absence of value by the absence of the value.
So for `cfg(feature, values())` we would print `feature=`.
I also added the missing tracking issue number in the doc.
r? ``@petrochenkov``
@NoratriebNoratrieb mentioned this pull request Jun 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 2024
Rollup of 9 pull requests
Successful merges:
- rust-lang#122804 (Item bounds can reference self projections and still be object safe)
- rust-lang#124486 (Add tracking issue and unstable book page for `"vectorcall"` ABI)
- rust-lang#125504 (Change pedantically incorrect OnceCell/OnceLock wording)
- rust-lang#125608 (Avoid follow-up errors if the number of generic parameters already doesn't match)
- rust-lang#125690 (ARM Target Docs Update)
- rust-lang#125750 (Align `Term` methods with `GenericArg` methods, add `Term::expect_*`)
- rust-lang#125818 (Handle no values cfgs with `--print=check-cfg`)
- rust-lang#125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE)
- rust-lang#125919 (Remove stray "this")
r? `@ghost`
`@rustbot` modify labels: rollup
@jieyouxujieyouxu mentioned this pull request Jun 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 2024
Rollup of 8 pull requests
Successful merges:
- rust-lang#124486 (Add tracking issue and unstable book page for `"vectorcall"` ABI)
- rust-lang#125504 (Change pedantically incorrect OnceCell/OnceLock wording)
- rust-lang#125608 (Avoid follow-up errors if the number of generic parameters already doesn't match)
- rust-lang#125690 (ARM Target Docs Update)
- rust-lang#125750 (Align `Term` methods with `GenericArg` methods, add `Term::expect_*`)
- rust-lang#125818 (Handle no values cfgs with `--print=check-cfg`)
- rust-lang#125909 (rustdoc: add a regression test for a former blanket impl synthesis ICE)
- rust-lang#125919 (Remove stray "this")
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 756af9d into rust-lang:masterJun 4, 2024
@rustbotrustbot added this to the 1.80.0 milestone Jun 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 2024
Rollup merge of rust-lang#125818 - Urgau:print-check-cfg-no-values, r=petrochenkov
Handle no values cfgs with `--print=check-cfg`
This PR fix a bug with `--print=check-cfg`, where no values cfgs where not printed since we only printed cfgs that had at least one values.
The representation I choose is `CFG=`, since it doesn't correspond to any valid config, it also IMO nicely complements the `values()` (to indicate no values). Representing the absence of value by the absence of the value.
So for `cfg(feature, values())` we would print `feature=`.
I also added the missing tracking issue number in the doc.
r? ```@petrochenkov```
@UrgauUrgau mentioned this pull request Jun 8, 2024
3 tasks
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jun 28, 2024
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.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Urgau@rustbot@bors@petrochenkov@jieyouxu