Skip to content

Refactor attr::Stability #29014

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

Merged
merged 3 commits into from
Oct 16, 2015
Merged

Refactor attr::Stability #29014

merged 3 commits into from
Oct 16, 2015

Conversation

petrochenkov
Copy link
Contributor

Stricter checking of stability attributes + enforcement of their invariants at compile time
(+ removed dead file librustc_front/attr.rs)
I intended to enforce use of reason for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have reasons.

r? @aturon
I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.

Stricter checking + enforcement of invariants at compile time
@aturon
Copy link
Member

aturon commented Oct 14, 2015

@petrochenkov Unfortunately I am about to disappear for a while on paternity leave. @brson, @huonw or @alexcrichton, can one of you review this PR please?

@aturon aturon removed their assignment Oct 14, 2015
@alexcrichton
Copy link
Member

Sure thing, I'll take over.

@alexcrichton alexcrichton self-assigned this Oct 14, 2015
@brson
Copy link
Contributor

brson commented Oct 14, 2015

Thanks for refactoring this. It's a lot better. This code has really been through the ringer.

@brson
Copy link
Contributor

brson commented Oct 14, 2015

Your PR message says this makes checking stricter. I saw that it now disallows unknown meta items in the stability attributes. What else does it do to strengthen the checking?

@petrochenkov
Copy link
Contributor Author

Your PR message says this makes checking stricter. I saw that it now disallows unknown meta items in the stability attributes. What else does it do to strengthen the checking?

The changes can mostly be noticed in tests (old and one new) - unknown meta items, duplicated meta items, issue is necessary on unstable, reason is necessary on deprecated.

@petrochenkov
Copy link
Contributor Author

@brson
Updated with rustdoc fix

@brson
Copy link
Contributor

brson commented Oct 15, 2015

Thanks, I added just one more question, reproduced here: what happens when there are both unstable and deprecated reasons. Does the unstable reason silently get overwritten? What was the previous behavior?

@petrochenkov
Copy link
Contributor Author

@brson

Does the unstable reason silently get overwritten? What was the previous behavior?

Previously unstable reason was overwritten by deprecated reason, now they are both kept, but rustdoc displays the deprecated reason as before.

@brson
Copy link
Contributor

brson commented Oct 16, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 16, 2015

📌 Commit 704d598 has been approved by brson

bors added a commit that referenced this pull request Oct 16, 2015
Stricter checking of stability attributes + enforcement of their invariants at compile time
(+ removed dead file librustc_front/attr.rs)
I intended to enforce use of `reason` for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have `reason`s.

r? @aturon 
I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.
@bors
Copy link
Collaborator

bors commented Oct 16, 2015

⌛ Testing commit 704d598 with merge 747d951...

@bors bors merged commit 704d598 into rust-lang:master Oct 16, 2015
@petrochenkov petrochenkov deleted the stability branch November 22, 2015 11:47
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.

5 participants