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

let else doesn't eagerly drop with _ pattern #94351

Closed
lcnr opened this issue Feb 25, 2022 · 4 comments
Closed

let else doesn't eagerly drop with _ pattern #94351

lcnr opened this issue Feb 25, 2022 · 4 comments
Labels
F-let_else Issues related to let-else statements (RFC 3137)

Comments

@lcnr
Copy link
Contributor

lcnr commented Feb 25, 2022

The handling and lifetimes of temporaries should be exactly the same with let and with let else; any understanding or intuitions that people have about let should apply to let else.

I think we have a bug then. 😢 (see playground)

Originally posted by @camsteffen in #93628 (comment)

@lcnr lcnr added the F-let_else Issues related to let-else statements (RFC 3137) label Feb 25, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Feb 25, 2022

i misunderstood the issue here i think

@lcnr lcnr closed this as completed Feb 25, 2022
@est31
Copy link
Member

est31 commented Feb 28, 2022

Why have you closed it? Drop order is different, and personally I think it would be a good idea to at least try fixing this issue.

@lcnr
Copy link
Contributor Author

lcnr commented Feb 28, 2022

the issue is that it doesn't drop eagerly with any pattern, not just _. see #94012 (comment) where I am looking into this

@est31
Copy link
Member

est31 commented Feb 28, 2022

I'd just have changed the issue title, as it's a bug one way or another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-let_else Issues related to let-else statements (RFC 3137)
Projects
None yet
Development

No branches or pull requests

2 participants