Refactor find_*_stability functions#109539
Merged
bors merged 3 commits intorust-lang:masterfrom Mar 25, 2023
Merged
Conversation
Collaborator
|
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
b-naber
approved these changes
Mar 24, 2023
Contributor
b-naber
left a comment
There was a problem hiding this comment.
Looks a lot better. r=me with or without the nits.
compiler/rustc_attr/src/builtin.rs
Outdated
| } | ||
| } | ||
| } | ||
| /// Collects stability info from all stability attributes in `attrs`. |
Contributor
There was a problem hiding this comment.
Can we update these comments or remove the first sentence? I feel that in their current form these aren't really helpful.
| body_stab | ||
| } | ||
|
|
||
| fn parse_stability(sess: &Session, attr: &Attribute) -> Option<(Symbol, StabilityLevel)> { |
Contributor
There was a problem hiding this comment.
Maybe add a brief doc comment for these?
compiler/rustc_attr/src/builtin.rs
Outdated
| fn parse_stability(sess: &Session, attr: &Attribute) -> Option<(Symbol, StabilityLevel)> { | ||
| let meta = attr.meta()?; | ||
| let MetaItem { kind: MetaItemKind::List(ref metas), .. } = meta else { return None }; | ||
| let insert = |meta: &MetaItem, item: &mut Option<Symbol>| { |
Contributor
There was a problem hiding this comment.
Maybe choose a more expressive name for this closure?
Contributor
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 25, 2023
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#109355 (Fix bad suggestion for clone/is_some in field init shorthand) - rust-lang#109484 (Bugfix: avoid panic on invalid json output from libtest) - rust-lang#109539 (Refactor `find_*_stability` functions) - rust-lang#109542 (rustdoc: clean up `storage.js`) - rust-lang#109545 (Deeply check well-formedness of return-position `impl Trait` in trait) - rust-lang#109568 (miri: fix raw pointer dyn receivers) - rust-lang#109570 (Add GUI test for "Auto-hide item methods' documentation" setting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea is to split the monolithic function into the 3 cases: stability, const stability, and body stability.