Skip to content
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 LetSource to hir::ExprKind::Let #88187

Closed
wants to merge 3 commits into from

Conversation

camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Aug 20, 2021

...instead of determining LetSource using hir::Map. This is used in #87688. And it may also be useful for factoring out Guard::IfLet.

@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 20, 2021
@rust-log-analyzer

This comment has been minimized.

@michaelwoerister
Copy link
Member

I'm not really familiar with the context here. @cjgillot seems to already be looking into the topic.
r? @cjgillot

@@ -419,6 +419,13 @@ enum AnonymousLifetimeMode {
PassThrough,
}

#[derive(Copy, Clone, Debug, PartialEq)]
enum ConditionScope {
Copy link
Contributor

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?

Copy link
Contributor Author

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?

@inquisitivecrystal inquisitivecrystal added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 24, 2021
@camsteffen
Copy link
Contributor Author

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.

@camsteffen camsteffen closed this Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants