Skip to content

needless_return_with_question_mark FN #16958

@samueltardieu

Description

@samueltardieu

Description

The following code should trigger needless_return_with_question_mark. Noticed while reviewing #16952.

fn expr_after_stmt() -> Result<(), ()> {
    return Err(())?;
    //~^ needless_return_with_question_mark
    Ok(())
}

@rustbot label +I-false-negative +C-bug
@rustbot claim

Version


Additional Labels

No response

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions