Skip to content

Add ui tests for test harness item walk and proc macro input gating - #159319

Open
akintewe wants to merge 2 commits into
rust-lang:mainfrom
akintewe:coverage-gap-tests
Open

Add ui tests for test harness item walk and proc macro input gating#159319
akintewe wants to merge 2 commits into
rust-lang:mainfrom
akintewe:coverage-gap-tests

Conversation

@akintewe

@akintewe akintewe commented Jul 15, 2026

Copy link
Copy Markdown

These add coverage for two compiler paths that real crates hit constantly but the test suite never exercised. Found by diffing coverage from compiling crates.io crates against the test suite's coverage, then confirmed by putting a panic in the functions and compiling the crates.

These add coverage for two compiler paths that real crates hit constantly but the test suite never exercised. Found by diffing coverage from compiling crates.io crates against the test suite's coverage, then confirmed by putting a panic in the functions and compiling the crates.

Functions covered that the suite previously didn't hit:

  • <InnerItemLinter as Visitor>::visit_where_predicate, visit_where_predicate_kind, visit_qself, visit_pat_field, visit_anon_const
  • <EntryPointCleaner as MutVisitor>::visit_where_predicate, flat_map_where_predicate, visit_where_predicate_kind, visit_qself, visit_pat_field, flat_map_pat_field
  • <GateProcMacroInput as Visitor>::visit_macro_def

For the test harness case this adds a harness revision to tests/ui/unpretty/exhaustive.rs that compiles it with --test, so the harness expansion visitors walk the complete AST instead of a hand-picked one. -Zunpretty=expanded stops before the analyses that make the hir revision fail.

The second test covers GateProcMacroInput::visit_macro_def, which only runs when an attribute proc macro is applied to an item containing a macro_rules! definition.

r? jackh726

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 15, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 15, 2026
@rustbot

rustbot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @jackh726 (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the coverage-gap-tests branch from e3d1f34 to 93ea130 Compare July 15, 2026 21:35
@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants