-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: Rename @has FILE PATTERN
to @hasraw FILE PATTERN
#100355
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
For future reference, I used variations of this Find&Replace regex: @matches ([^ ]+) ("[^"]+")$ @matchestext $1 $2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several instances of multiline commands that were incorrectly that I'll need to fixup manually.
This comment has been minimized.
This comment has been minimized.
@has FILE PATTERN
to @hastext FILE PATTERN
@has FILE PATTERN
to @hasraw FILE PATTERN
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Oops forgot to update |
☔ The latest upstream changes (presumably #100456) made this pull request unmergeable. Please resolve the merge conflicts. |
See rust-lang#100354 for the rationale.
Reasons: 1. It's shorter. 2. `@matches-literal` seems to contradict itself: a regex is intrinsically not a literal match, while it is still a textual match.
I think `@hasraw` is slightly clearer than `@hastext` since it is actually matching against the raw HTML, not the text nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments at each place where I noticed that @!has
was being used incorrectly before. It used @!has
(or the other commands) with an XPath that was actually treated as a literal string of HTML code. All or almost all of the uses were with the negated commands (e.g., `@!has) since otherwise the tests would've noticeably failed.
`@!has` (and `@!matches`) with two arguments used to treat the second argument as a literal string of HTML code. Now, that feature has been renamed into `@!hasraw` (and `@!matchesraw`), and the arity-2 `@!has` version is an error. These uses thought the second argument was being treated as an XPath, as with the arity-3 version, but in fact was being treated as literal HTML. Because these were checking for the *absence* of the string, the tests silently did nothing -- an XPath string won't ever be showing up in the test's generated HTML!
Ok, I fixed all the incorrect uses of |
Maybe r? @GuillaumeGomez (@Mark-Simulacrum feel free to review if you'd like, though not sure why highfive assigned you since this is rustdoc-related) |
I'm confused: didn't you say in the issue that the problem was the commands should have a different name when then they had 2 vs 3 arguments? Because otherwise, I don't see the point of this PR: the command name is longer and definitely not more helpful. |
That's what this PR does: it renames the 2-argument version to As you can see in the last commit, it turns out that a lot of tests made the same mistake I did and thought Does that help? If not, please let me know which part you want me to clarify. |
Note the 3-argument version keeps its name in this PR; only the 2-argument version is different. |
Sorry, I completely missed it somehow. I'll make another review shortly then. Thanks for the extra explanation! |
Thanks! @bors r+ |
…mpiler-errors Rollup of 11 pull requests Successful merges: - rust-lang#100355 (rustdoc: Rename ``@has` FILE PATTERN` to ``@hasraw` FILE PATTERN`) - rust-lang#100407 (avoid some int2ptr casts in thread_local_key tests) - rust-lang#100434 (Fix HIR pretty printing of let else) - rust-lang#100438 (Erase regions better in `promote_candidate`) - rust-lang#100445 (adapt test for msan message change) - rust-lang#100447 (Remove more Clean trait implementations) - rust-lang#100464 (Make `[rust] use-lld=true` work on windows) - rust-lang#100475 (Give a helpful diagnostic when the next struct field has an attribute) - rust-lang#100490 (wf: correctly `shallow_resolve` consts) - rust-lang#100501 (nicer Miri backtraces for from_exposed_addr) - rust-lang#100509 (merge two test directories that mean the same thing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #100354.