Skip to content

htmldocck: better error messages for some negative directives #143814

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

Merged
merged 1 commit into from
Jul 13, 2025

Conversation

lolbinarycat
Copy link
Contributor

Previously it was saying "did not match pattern" even when the error was that it did match the pattern, and it wasn't supposed to.

@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 11, 2025
@jieyouxu
Copy link
Member

r? rustdoc

@rustbot rustbot assigned notriddle and unassigned Mark-Simulacrum Jul 12, 2025
@fmease fmease changed the title htmldocck: better error messages for negative raw directives htmldocck: better error messages for negative directives Jul 12, 2025
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Other directives like !count also give a weird error message (e.g., "Expected 3 occurrences but found 3") but one thing at a time.

@fmease
Copy link
Member

fmease commented Jul 12, 2025

Thanks! @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 12, 2025

📌 Commit 507fd38 has been approved by fmease

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 Jul 12, 2025
@lolbinarycat
Copy link
Contributor Author

one thing at a time.

I'm confused as to why you changed the title then, since this is specifically improves the raw directives.

@fmease
Copy link
Member

fmease commented Jul 12, 2025

since this is specifically improves the raw directives.

Nope, you've also improved the diagnostic for has and matches which are obviously not raw:

             # has/matches <path> <pat> <match> = XML tree test
             elif len(c.args) == 3 and "raw" not in c.cmd:
                 cerr = "`XPATH PATTERN` did not match"
+                if c.negated:
+                    cerr = "`XPATH PATTERN` unexpectedly matched"

Edit: But I've now added "some" to better reflect reality.

@fmease fmease changed the title htmldocck: better error messages for negative directives htmldocck: better error messages for some negative directives Jul 12, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 12, 2025
…r, r=fmease

htmldocck: better error messages for some negative directives

Previously it was saying "did not match pattern" even when the error was that it did match the pattern, and it wasn't supposed to.
bors added a commit that referenced this pull request Jul 12, 2025
Rollup of 15 pull requests

Successful merges:

 - #143554 (slice: Mark `rotate_left`, `rotate_right` unstably const)
 - #143634 (interpret/allocation: expose init + write_wildcards on a range)
 - #143710 (Updates to random number generation APIs)
 - #143774 (constify `From` and `Into`)
 - #143776 (std: move NuttX to use arc4random for random number generation)
 - #143778 (Some const_trait_impl test cleanups)
 - #143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - #143791 (Update sysinfo version to `0.36.0`)
 - #143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - #143798 (Remove format short command trait)
 - #143803 (New tracking issues for const_ops and const_cmp)
 - #143814 (htmldocck: better error messages for some negative directives)
 - #143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - #143822 (./x test miri: fix cleaning the miri_ui directory)
 - #143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 13, 2025
Rollup of 12 pull requests

Successful merges:

 - #143776 (std: move NuttX to use arc4random for random number generation)
 - #143778 (Some const_trait_impl test cleanups)
 - #143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - #143791 (Update sysinfo version to `0.36.0`)
 - #143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - #143798 (Remove format short command trait)
 - #143803 (New tracking issues for const_ops and const_cmp)
 - #143814 (htmldocck: better error messages for some negative directives)
 - #143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - #143822 (./x test miri: fix cleaning the miri_ui directory)
 - #143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)
 - #143841 (Label clippy changes with `T-clippy`)

Failed merges:

 - #143850 (Compiletest: Simplify {Html,Json}DocCk directive handling)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f8bbc91 into rust-lang:master Jul 13, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 13, 2025
rust-timer added a commit that referenced this pull request Jul 13, 2025
Rollup merge of #143814 - lolbinarycat:htmldocck-negative-err, r=fmease

htmldocck: better error messages for some negative directives

Previously it was saying "did not match pattern" even when the error was that it did match the pattern, and it wasn't supposed to.
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants