Skip to content

tests/ui/cfg: add annotations for reference rules#153325

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
DanielEScherzer:test-references-conditional-compilation
Mar 10, 2026
Merged

tests/ui/cfg: add annotations for reference rules#153325
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
DanielEScherzer:test-references-conditional-compilation

Conversation

@DanielEScherzer
Copy link
Contributor

r? ehuss
@rustbot label +A-docs

@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. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Mar 3, 2026
//@ compile-flags: --cfg foo=1x
//@ reference: cfg.option-spec
//@ reference: cfg.option-name
//@ reference: cfg.option-key-value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you say why this includes cfg.option-spec and cfg.option-name? It looks like this test is just validating the error case when the value is not a valid string (which I think is covered by cfg.option-key-value).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that cfg.option-key-value was saying "here is how to use cfg with a key-value pair" and that cfg.option-spec (saying that cfg options are either names or key-value pairs) and cfg.option-name (allowing names) are all tested by confirming that something other than a key-value pair is not allowed. I would say that

validating the error case when the value is not a valid string

is not just cfg.option-key-value since I read cfg.option-key-value to describe one thing that is accepted (key-value pairs where the value is a string) but on its own that rule isn't enough to say that things like foo=1x are not accepted, only with all three rules do you get the exhaustiveness

@DanielEScherzer DanielEScherzer force-pushed the test-references-conditional-compilation branch from 7d98a51 to 226b4dd Compare March 6, 2026 06:45
@ehuss
Copy link
Contributor

ehuss commented Mar 9, 2026

Thanks!

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 9, 2026

📌 Commit 226b4dd has been approved by ehuss

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Mar 9, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
Rollup of 4 pull requests

Successful merges:

 - #148562 (In `Option::get_or_insert_with()`, forget the `None` instead of dropping it.)
 - #153325 (tests/ui/cfg: add annotations for reference rules)
 - #153621 (Remove `TyCtxt::node_span_lint` method)
 - #153627 (rustdoc-json: Improve docs for `ItemEnum::item_kind`)
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…ompilation, r=ehuss

tests/ui/cfg: add annotations for reference rules
@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 10, 2026

💔 Test for c49e635 failed: CI. Failed job:

@Zalathar
Copy link
Member

@bors retry

@rust-bors rust-bors bot 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 Mar 10, 2026
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
Rollup of 4 pull requests

Successful merges:

 - #148562 (In `Option::get_or_insert_with()`, forget the `None` instead of dropping it.)
 - #153325 (tests/ui/cfg: add annotations for reference rules)
 - #153621 (Remove `TyCtxt::node_span_lint` method)
 - #153627 (rustdoc-json: Improve docs for `ItemEnum::item_kind`)
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-debug failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
/dev/sda15       98M  6.4M   92M   7% /boot/efi
tmpfs           1.6G   16K  1.6G   1% /run/user/1001
================================================================================

Sufficient disk space available (120767352KB >= 52428800KB). Skipping cleanup.
##[group]Run src/ci/scripts/setup-environment.sh
src/ci/scripts/setup-environment.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
[1646/5488] Linking CXX static library lib/libclangAnalysis.a
[1647/5488] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesTypes.cpp.o
[1648/5488] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesYAMLCompiler.cpp.o
[1649/5488] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesWriter.cpp.o
[1650/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o
[1651/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o
[1652/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o
[1653/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
[1654/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeStats.cpp.o
[1655/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o
[1656/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o
[1657/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o
[1658/5488] Building CXX object tools/clang/lib/Edit/CMakeFiles/obj.clangEdit.dir/Commit.cpp.o
[1659/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
[1660/5488] Building CXX object tools/clang/lib/Edit/CMakeFiles/obj.clangEdit.dir/EditedSource.cpp.o
[1661/5488] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o
[1662/5488] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/Arg.cpp.o
---
[2448/5488] Building AArch64GenSystemOperands.inc...
[2449/5488] Building AArch64GenInstrInfo.inc...
[2450/5488] Building AArch64GenSubtargetInfo.inc...

##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
Session terminated, killing shell...::group::Clock drift check
  local time: Tue Mar 10 09:44:37 UTC 2026
  network time: Tue, 10 Mar 2026 09:44:37 GMT
##[endgroup]
 ...killed.
##[error]The operation was canceled.

rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
Rollup of 4 pull requests

Successful merges:

 - #148562 (In `Option::get_or_insert_with()`, forget the `None` instead of dropping it.)
 - #153325 (tests/ui/cfg: add annotations for reference rules)
 - #153621 (Remove `TyCtxt::node_span_lint` method)
 - #153627 (rustdoc-json: Improve docs for `ItemEnum::item_kind`)
@rust-bors rust-bors bot merged commit 4e0adfe into rust-lang:main Mar 10, 2026
11 of 12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 10, 2026
rust-timer added a commit that referenced this pull request Mar 10, 2026
Rollup merge of #153325 - DanielEScherzer:test-references-conditional-compilation, r=ehuss

tests/ui/cfg: add annotations for reference rules
@DanielEScherzer DanielEScherzer deleted the test-references-conditional-compilation branch March 10, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools 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