Skip to content

or_fun_call doesn't trigger on unsafe blocks #6675

Closed

Description

I tried this code (playground):

unsafe fn f() {
    None.unwrap_or(String::new().as_mut_vec());
}

fn g() {
    None.unwrap_or(unsafe { String::new().as_mut_vec() });
}

I expected to see this happen: Clippy warns on both f and g.

Instead, this happened: Clippy only warns on f.

Meta

  • cargo clippy -V: 0.1.51 (2021-02-03 e708cbd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedgood-first-issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions