-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Add all remaining DefKinds.
#70043
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 DefKinds.
#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.
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
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 asDefKinds (e.g.Arm) because they don't feel like definitions. Are there things that it makes sense not to add?