Skip to content
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

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

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented May 31, 2024

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

@rustbot rustbot 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
Collaborator

rustbot commented May 31, 2024

Some changes occurred in run-make tests.

cc @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``
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 Urgau force-pushed the print-check-cfg-no-values branch from 2a4c6b3 to f58bf91 Compare June 2, 2024 09:49
@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 3, 2024

📌 Commit f58bf91 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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`
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``
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
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:master Jun 4, 2024
6 checks passed
@rustbot rustbot 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```
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant 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