-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
I-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
rust-lang/rust#148190 caused a regression for the unwrap_or_default lint around the vec! macro. Code like this no longer triggers the lint:
let with_new = Some(vec![1]);
with_new.unwrap_or_else(Vec::new);Curiously, adding a type annotation to the let brings the lint back (see the clippy test diff of that PR).
We weren't able to fully figure out why this happens, but the best lead was that the change in the vec! macro lowering confused expr_type_is_certain, making it no longer consider the type of with_new to be certain, thus silencing the lint.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
I-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Type
Fields
Give feedbackNo fields configured for issues without a type.