-
Couldn't load subscription status.
- Fork 13.9k
Add LetSource to hir::ExprKind::Let
#88187
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
Conversation
|
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
|
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| #[derive(Copy, Clone, Debug, PartialEq)] | ||
| enum ConditionScope { |
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.
Why have separate LetSource and ConditionScope types?
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.
Yeah I guess they are interchangeable. It's just that LetSource makes more sense in ExprKind::Let and Option<ConditionScope> makes more sense in LoweringContext. Should I just use LetSource?
|
It occurred to me that this may be unnecessary. LetSource sort of conflates desugaring kind with HIR ancestor context. And I think the LetSource calculation can easily be moved off of the happy path. |
...instead of determining
LetSourceusinghir::Map. This is used in #87688. And it may also be useful for factoring outGuard::IfLet.