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

Fix rustdoc test directives that were accidentally ignored 🧐 #137099

Merged

Conversation

yotamofek
Copy link
Contributor

@yotamofek yotamofek commented Feb 15, 2025

Replace "// @" with "//@ ", and fix the tests so they actually pass, after directives are checked.
Only the first commit is mandatory, other two are small drive-bys.

@rustbot
Copy link
Collaborator

rustbot commented Feb 15, 2025

r? @fmease

rustbot has assigned @fmease.
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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Feb 15, 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.

Thanks for catching this! 🙏 We might want to modify {html,json}docck to reject // @ for the time being which is the retired syntax of these directives.

I'm not sure sure about the second commit though.

The fmt'ing commit is okay but generally we don't want to format tests as that may break them and since it's a bit churn-y.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how this makes it "more explicit in what it checks". #25001 is about items with duplicate names (here: quux), so I'm not sure why return types are relevant here?

Copy link
Contributor Author

@yotamofek yotamofek Feb 15, 2025

Choose a reason for hiding this comment

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

I found this test was broken when I was messing around with the way the trait implementations for a certain type are ordered.
The //@ has directives for the associated type also make their order doesn't change, not just that there are three unique IDs, since the different types are part of the test. I thought it would be nice if the trait methods acted the same way, not because of the specific issue the test was written for, but just generally so if the order ever changes, it's not accidental.
I don't mind reverting this commit though :)

Copy link
Member

Choose a reason for hiding this comment

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

I'll check and reply later today

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please don't waste too much time on this, it's completely inconsequential. :)

//@ has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)'
fn quux(self) {}
//@ has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self) -> T'
fn quux(self) -> T {}
Copy link
Member

Choose a reason for hiding this comment

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

Also, while rustdoc supports it by virtue of not really resolving and typeck'ing function bodies, it'd rather see loop {} or unimplemented!() in there rather than a "dormant" type error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, didn't even notice this won't compile.

@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 15, 2025
replace "// @" with "//@ ", and fix the tests so they actually pass, after directives are checked
@yotamofek
Copy link
Contributor Author

Hey @fmease , I rebased with just that first, less contentious commit. Hoping to get it in so it can also unblock #137103 😊
The other two commits weren't that important anyways.

@yotamofek yotamofek force-pushed the pr/rustdoc/fix-ignored-test-directives branch from 059d284 to 2c1f489 Compare February 16, 2025 19:36
@fmease
Copy link
Member

fmease commented Feb 23, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 23, 2025

📌 Commit 2c1f489 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 23, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#136439 (Misc. `rustc_codegen_ssa` cleanups 🧹)
 - rust-lang#136543 (intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic)
 - rust-lang#136637 (Add binary_format to rustc target specs)
 - rust-lang#137099 (Fix rustdoc test directives that were accidentally ignored 🧐)
 - rust-lang#137297 (Update `compiler-builtins` to 0.1.147)
 - rust-lang#137451 (FIx `sym` -> `syn` typo in tail-expr-drop-order type opt-out)
 - rust-lang#137452 (bootstrap: add module docs for core:metadata)
 - rust-lang#137483 (rename sub_ptr to offset_from_unsigned)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#136439 (Misc. `rustc_codegen_ssa` cleanups 🧹)
 - rust-lang#136543 (intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic)
 - rust-lang#136637 (Add binary_format to rustc target specs)
 - rust-lang#137099 (Fix rustdoc test directives that were accidentally ignored 🧐)
 - rust-lang#137297 (Update `compiler-builtins` to 0.1.147)
 - rust-lang#137451 (FIx `sym` -> `syn` typo in tail-expr-drop-order type opt-out)
 - rust-lang#137452 (bootstrap: add module docs for core:metadata)
 - rust-lang#137483 (rename sub_ptr to offset_from_unsigned)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5f35f78 into rust-lang:master Feb 24, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 24, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 24, 2025
Rollup merge of rust-lang#137099 - yotamofek:pr/rustdoc/fix-ignored-test-directives, r=fmease

Fix rustdoc test directives that were accidentally ignored 🧐

Replace "// `@"` with "//@ ", and fix the tests so they actually pass, after directives are checked.
~~Only the first commit is mandatory, other two are small drive-bys.~~
@yotamofek yotamofek deleted the pr/rustdoc/fix-ignored-test-directives branch February 24, 2025 21:24
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 28, 2025
…directives, r=notriddle

Fix (more) test directives that were accidentally ignored

Continuation of rust-lang#137099 , caught by rust-lang#137103 (and needed to unblock that one).
These test directives were accidentally using the old (`// `@`)` syntax
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 28, 2025
…directives, r=notriddle

Fix (more) test directives that were accidentally ignored

Continuation of rust-lang#137099 , caught by rust-lang#137103 (and needed to unblock that one).
These test directives were accidentally using the old (`// ``@`)`` syntax
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Feb 28, 2025
…directives, r=notriddle

Fix (more) test directives that were accidentally ignored

Continuation of rust-lang#137099 , caught by rust-lang#137103 (and needed to unblock that one).
These test directives were accidentally using the old (`// ```@`)``` syntax
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2025
Rollup merge of rust-lang#137540 - yotamofek:pr/more-deprecated-test-directives, r=notriddle

Fix (more) test directives that were accidentally ignored

Continuation of rust-lang#137099 , caught by rust-lang#137103 (and needed to unblock that one).
These test directives were accidentally using the old (`// ```@`)``` syntax
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 1, 2025
…ted-syntax, r=aDotInTheVoid

{json|html}docck: catch and error on deprecated syntax

rust-lang#137099 (review)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 2, 2025
…ted-syntax, r=aDotInTheVoid

{json|html}docck: catch and error on deprecated syntax

rust-lang#137099 (review)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 2, 2025
…ted-syntax, r=aDotInTheVoid

{json|html}docck: catch and error on deprecated syntax

rust-lang#137099 (review)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 3, 2025
…ted-syntax, r=aDotInTheVoid

{json|html}docck: catch and error on deprecated syntax

rust-lang#137099 (review)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2025
Rollup merge of rust-lang#137103 - yotamofek:pr/jsonhtmldocck-deprecated-syntax, r=aDotInTheVoid

{json|html}docck: catch and error on deprecated syntax

rust-lang#137099 (review)
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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants