Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Dec 2, 2025

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Dec 2, 2025
@JonathanBrouwer
Copy link
Contributor Author

This is a mix from what I learned about the attribute from my first time interacting with it today, and copy pasting from some doc-comments in the rustc source code.

r? rustc-dev-guide

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

nice, thanks! r=me with or without fixing the nits.

Comment on lines +197 to +201
* `cfg="<cond>"` — checks the cfg condition `<cond>`, and only runs the check if the config condition evaluates to true.
This can be used to only run the `rustc_clean` attribute in a specific revision.
* `except="<query1>,<query2>,..."` — asserts that the query results for the listed queries must be different,
rather than the same.
* `loaded_from_disk="<query1>,<query2>,..."` — asserts that the query results for the listed queries
Copy link
Member

Choose a reason for hiding this comment

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

could you also add a bullet about label?

if it's not too much trouble, it would be nice to update the template at https://github.com/rust-lang/rust/blob/646a3f8c15baefb98dc6e0c1c1ba3356db702d2a/compiler/rustc_feature/src/builtin_attrs.rs#L1493 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm I've looked at the source code in dirty_clean.rs for a few minutes but I don't fully understand how they work. I don't want to explain it incorrectly so I'll leave this one for someone else to add

@jyn514
Copy link
Member

jyn514 commented Dec 2, 2025

it also occurs to me that this is a port of the comment in persist/dirty_clean.rs; maybe that comment should point to the dev-guide once this gets merged, so they don't get out of sync?

@JonathanBrouwer JonathanBrouwer merged commit 3e91b0f into main Dec 3, 2025
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Dec 3, 2025
@tshepang tshepang deleted the rustc_clean branch December 3, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants