-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add all remaining DefKind
s.
#70043
Add all remaining DefKind
s.
#70043
Conversation
Also, is this the right |
I concur, this feels rather strange to me as well. cc @petrochenkov |
@mark-i-m So, the only things with I'll leave comments on the variants which you have and I think can't have |
Btw, you'd also want to change this: rust/src/librustc_metadata/rmeta/decoder.rs Lines 523 to 528 in 59f4ba9
If you're committed to adding all |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
EntryKind::ForeignMod => DefKind::ForeignMod, | ||
EntryKind::GlobalAsm => DefKind::GlobalAsm, | ||
EntryKind::Field => DefKind::Field, | ||
EntryKind::Generator(_) => DefKind::Closure, |
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.
Hmm should we have a DefKind::Generator
? I forgot about that.
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 thought about that too. I think it would be preferable, but how would we tell from a Node::Expr
if something is a generator (i.e. in librustc_hir)?
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.
You have a TyCtxt
so you probably have a way to check. @Zoxc would know more.
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.
You can tell if it's a generator from ExprKind::Closure
, not sure if we should have a DefKind::Generator
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.
@Zoxc Sorry, I don't quite understand. How can you tell from ExprKind::Closure
?
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.
The Option<Movability>
field will be Some
for generators.
☔ The latest upstream changes (presumably #71215) made this pull request unmergeable. Please resolve the merge conflicts. |
make Map::def_kind take LocalDefId Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> crates are DefKind::Mod
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@JohnTitor @eddyb rebased, ci passing |
@bors r+ delegate=mark-i-m |
📌 Commit 258ebfe has been approved by |
✌️ @mark-i-m can now approve this pull request |
Add all remaining `DefKind`s. r? @eddyb or @Centril ~~I'm not sure if this is what you were thinking of. There are also a few places where I'm not sure what the correct choice is because I don't fully understand the meaning of some variants.~~ ~~In general, it feels a bit odd to add some of these as `DefKind`s (e.g. `Arm`) because they don't feel like definitions. Are there things that it makes sense not to add?~~
Rollup of 5 pull requests Successful merges: - rust-lang#70043 (Add all remaining `DefKind`s.) - rust-lang#71140 ([breaking change] Disallow statics initializing themselves) - rust-lang#71392 (Don't hold the predecessor cache lock longer than necessary) - rust-lang#71541 (Add regression test for rust-lang#26376) - rust-lang#71554 (Replace thread_local with generator resume arguments in box_region.) Failed merges: r? @ghost
rustup to rust-lang/rust#70043 changelog: none
Changes: ```` rustup to rust-lang#70043 map_clone: avoid suggesting `copied()` for &mut fix redundant_pattern_matching lint Add tests for rust-lang#1654 Don't trigger while_let_on_iterator when the iterator is recreated every iteration Update issue_2356.stderr reference file Update while_let_on_iterator tests Fix while_let_on_iterator suggestion and make it MachineApplicable Add lifetime test case for `new_ret_no_self` rustup rust-lang#71215 Downgrade match_bool to pedantic Run fetch before testing if master contains beta The beta branch update should not require a force push Add a note to the beta sections of release.md Remove apt-get upgrade again Always use the deploy script and templates of the master branch README: fix lit count line clippy_dev: make it fatal when the regex for updating lint count does not match `predecessors_for` will be removed soon Rustup "Remove `BodyAndCache`" Only run (late) internal lints, when they are warn/deny/forbid Only run cargo lints, when they are warn/deny/forbid span_lint_and_note now takes an Option<Span> for the note_span instead of just a span Make lint also capture blocks and closures, adjust language to mention other mutex types don't test the code in the lint docs Switch to matching against full paths instead of just the last element of the path Lint for holding locks across await points Also mention `--fix` for nightly users fix crash on issue-69020-assoc-const-arith-overflow.rs Address review comments remark fixes Update CHANGELOG.md for Rust 1.43 and 1.44 update stderr file util/fetch_prs_between.sh: Add Markdown formatted Link factor ifs into function, add differing mutex test Update the changelog update documentation Apply suggestions from PR review update span_lint_and_help call to six args test for mutex eq, add another test case use if chain cargo dev fmt fix map import to rustc_middle dev update_lints fix internal clippy warnings change visitor name to OppVisitor use Visitor api to find Mutex::lock calls add note about update-all-refs script, revert redundant pat to master move closures to seperate fns, remove known problems use span_lint_and_help, cargo dev fmt creating suggestion progress work on suggestion for auto fix Implement unsafe_derive_deserialize lint Update empty_enum.stderr Formatting and naming Formatting and naming Cleanup: `node_id` -> `hir_id` Fix issue rust-lang#2907. Don't trigger toplevel_ref_arg for `for` loops Cleanup: future_not_send: use `return_ty` method Remove badge FIXME from Cargo.toml Change note_span argument for span_lint_and_note. Add an Option<Span> argument to span_lint_and_help. Fixes internal lint warning in code base. Implement collapsible_span_lint_calls lint. ```` Fixes rust-lang#71453
Changes: ```` rustup to rust-lang/rust#70043 map_clone: avoid suggesting `copied()` for &mut fix redundant_pattern_matching lint Add tests for rust-lang#1654 Don't trigger while_let_on_iterator when the iterator is recreated every iteration Update issue_2356.stderr reference file Update while_let_on_iterator tests Fix while_let_on_iterator suggestion and make it MachineApplicable Add lifetime test case for `new_ret_no_self` rustup rust-lang/rust#71215 Downgrade match_bool to pedantic Run fetch before testing if master contains beta The beta branch update should not require a force push Add a note to the beta sections of release.md Remove apt-get upgrade again Always use the deploy script and templates of the master branch README: fix lit count line clippy_dev: make it fatal when the regex for updating lint count does not match `predecessors_for` will be removed soon Rustup "Remove `BodyAndCache`" Only run (late) internal lints, when they are warn/deny/forbid Only run cargo lints, when they are warn/deny/forbid span_lint_and_note now takes an Option<Span> for the note_span instead of just a span Make lint also capture blocks and closures, adjust language to mention other mutex types don't test the code in the lint docs Switch to matching against full paths instead of just the last element of the path Lint for holding locks across await points Also mention `--fix` for nightly users fix crash on issue-69020-assoc-const-arith-overflow.rs Address review comments remark fixes Update CHANGELOG.md for Rust 1.43 and 1.44 update stderr file util/fetch_prs_between.sh: Add Markdown formatted Link factor ifs into function, add differing mutex test Update the changelog update documentation Apply suggestions from PR review update span_lint_and_help call to six args test for mutex eq, add another test case use if chain cargo dev fmt fix map import to rustc_middle dev update_lints fix internal clippy warnings change visitor name to OppVisitor use Visitor api to find Mutex::lock calls add note about update-all-refs script, revert redundant pat to master move closures to seperate fns, remove known problems use span_lint_and_help, cargo dev fmt creating suggestion progress work on suggestion for auto fix Implement unsafe_derive_deserialize lint Update empty_enum.stderr Formatting and naming Formatting and naming Cleanup: `node_id` -> `hir_id` Fix issue rust-lang#2907. Don't trigger toplevel_ref_arg for `for` loops Cleanup: future_not_send: use `return_ty` method Remove badge FIXME from Cargo.toml Change note_span argument for span_lint_and_note. Add an Option<Span> argument to span_lint_and_help. Fixes internal lint warning in code base. Implement collapsible_span_lint_calls lint. ```` Fixes #71453
r? @eddyb or @Centril
I'm not sure if this is what you were thinking of. There are also a few places where I'm not sure what the correct choice is because I don't fully understand the meaning of some variants.In general, it feels a bit odd to add some of these asDefKind
s (e.g.Arm
) because they don't feel like definitions. Are there things that it makes sense not to add?