-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix rustdoc test directives that were accidentally ignored 🧐 #137099
Conversation
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.
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.
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.
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?
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.
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 :)
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.
I'll check and reply later today
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.
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 {} |
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.
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.
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.
Oops, didn't even notice this won't compile.
replace "// @" with "//@ ", and fix the tests so they actually pass, after directives are checked
059d284
to
2c1f489
Compare
@bors r+ rollup |
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
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
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.~~
…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
…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
…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
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
…ted-syntax, r=aDotInTheVoid {json|html}docck: catch and error on deprecated syntax rust-lang#137099 (review)
…ted-syntax, r=aDotInTheVoid {json|html}docck: catch and error on deprecated syntax rust-lang#137099 (review)
…ted-syntax, r=aDotInTheVoid {json|html}docck: catch and error on deprecated syntax rust-lang#137099 (review)
…ted-syntax, r=aDotInTheVoid {json|html}docck: catch and error on deprecated syntax rust-lang#137099 (review)
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)
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.