Skip to content

Conversation

@samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Sep 15, 2025

This recognizes the following expression as being equivalent to the question mark:

match x {
    Ok(v) => v,
    Err(e) => return Err(e.into()), // or `Into::into(x)` or `<T as Into<U>>::into(x)`
}

Fixes #15679

changelog: [question_mark]: recognizes a match with an early return with a call to .into() as possibly equivalent to a question mark

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jarcho Jarcho added this pull request to the merge queue Sep 16, 2025
Merged via the queue into rust-lang:master with commit 2a6197e Sep 16, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 16, 2025
@samueltardieu samueltardieu deleted the issue15679 branch September 17, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

question_mark doesn't identify the canonical form of ? for Result

3 participants