-
-
Notifications
You must be signed in to change notification settings - Fork 17.3k
if let should pre-drop wrt else #103108
Copy link
Copy link
Closed
Labels
A-let-chainsArea: let chains (if-let, while-let, ...)Area: let chains (if-let, while-let, ...)F-if_let_guard`#![feature(if_let_guard)]``#![feature(if_let_guard)]`T-langRelevant to the language teamRelevant to the language team
Description
Activity
Metadata
Metadata
Assignees
Labels
A-let-chainsArea: let chains (if-let, while-let, ...)Area: let chains (if-let, while-let, ...)F-if_let_guard`#![feature(if_let_guard)]``#![feature(if_let_guard)]`T-langRelevant to the language teamRelevant to the language team
Consider this snippet:
Here,
if letcomplains about an access offooin the else branch, whileifis okay with this.This is due to
if letdropping its temporaries after theelseblock. This is not neccessary, it could also drop them before.Similar to #103107
cc @Nilstrieb
@rustbot label T-lang