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

Question mark in a closure gives an error #1089

Closed
maximebuyse opened this issue Oct 31, 2024 · 0 comments · Fixed by #1101
Closed

Question mark in a closure gives an error #1089

maximebuyse opened this issue Oct 31, 2024 · 0 comments · Fixed by #1101
Assignees
Labels
bug Something isn't working engine Issue in the engine regression Something used to work but doesn't anymore

Comments

@maximebuyse
Copy link
Contributor

maximebuyse commented Oct 31, 2024

fn test(x: Option<i32>, y: Option<i32>) -> Option<i32> {
    x.map(|i| Some(i + y?))?
}

Open this code snippet in the playground

This gives the following error:

error: [HAX0002] (DropReturnBreakContinue) Fatal error: something we considered as impossible occurred! Please report this by submitting an issue on GitHub!
Details: Return/Break/Continue are expected to be gone as this point
 --> src/lib.rs:3:24
  |
3 |     x.map(|i| Some(i + y?))?

This is another regression from #393.

@maximebuyse maximebuyse added bug Something isn't working engine Issue in the engine labels Oct 31, 2024
@franziskuskiefer franziskuskiefer added the regression Something used to work but doesn't anymore label Oct 31, 2024
@maximebuyse maximebuyse self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working engine Issue in the engine regression Something used to work but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants