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

Use desc as a doc-comment for queries if there are no doc comments #80337

Merged
merged 1 commit into from
Dec 30, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 23, 2020

This at least gives some idea of what the query does even if it's not very readable. Some examples:

image
image
image

I want to turn {} into either _ or the stringified expr, but I'm not sure how to do that. In the meantime, this is better than having no docs at all.

@jyn514 jyn514 added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) labels Dec 23, 2020
@rust-highfive
Copy link
Collaborator

r? @varkor

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 23, 2020
@rust-log-analyzer

This comment has been minimized.

@camelid camelid added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Dec 24, 2020
Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

It might be useful to display the output differently in these cases, to highlight that it's not a proper doc comment. Maybe in square brackets, or prefixed with "Short description:" or something like that? Is there a test we can add to ensure this continues working?

compiler/rustc_macros/src/query.rs Show resolved Hide resolved
compiler/rustc_macros/src/query.rs Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

@varkor
Copy link
Member

varkor commented Dec 30, 2020

Thanks! Could you squash the commits? r=me after that.

- Replace {} with the stringified expr

  Giant thank you to `@danielhenrymantilla` for figuring out how to make
  this work ❤️

- Note that this is just an approximation and it would be better to add
  a doc-comment
@jyn514
Copy link
Member Author

jyn514 commented Dec 30, 2020

@bors r=varkor

@bors
Copy link
Contributor

bors commented Dec 30, 2020

📌 Commit e67f9d3 has been approved by varkor

@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 Dec 30, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#80185 (Fix ICE when pointing at multi bytes character)
 - rust-lang#80260 (slightly more typed interface to panic implementation)
 - rust-lang#80311 (Improvements to NatVis support)
 - rust-lang#80337 (Use `desc` as a doc-comment for queries if there are no doc comments)
 - rust-lang#80381 (Revert "Cleanup markdown span handling")
 - rust-lang#80492 (remove empty wraps, don't return Results from from infallible functions)
 - rust-lang#80509 (where possible, pass slices instead of &Vec or &String (clippy::ptr_arg))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 18ac1ec into rust-lang:master Dec 30, 2020
@rustbot rustbot added this to the 1.51.0 milestone Dec 30, 2020
@jyn514 jyn514 deleted the add-query-desc branch December 30, 2020 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants