-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Check for Default
trait implementation in initial condition when linting [manual_unwrap_or_default
]
#12566
Check for Default
trait implementation in initial condition when linting [manual_unwrap_or_default
]
#12566
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
Default
trait implementation in initial conditionDefault
trait implementation in initial condition when linting [manual_unwrap_or_default
]
r? @Jarcho |
☔ The latest upstream changes (presumably #12579) made this pull request unmergeable. Please resolve the merge conflicts. |
I want to be clear: this is just the initial draft outlining what, I think, should be the responsibilities of the team members. It has not yet been discussed with anyone else.
Instead of just saying “this function's stack frame is big”, report: * the (presumed) size of the frame * the size and type of the largest local contributing to that size * the configurable limit that was exceeded (once)
Signed-off-by: shandongbinzhou <[email protected]>
This extends the `filter_map_identity` lint to support typed closures. For untyped closures, we know that the program compiles, and therefore we can safely suggest using flatten. For typed closures, they may participate in type resolution. In this case we use `Applicability::MaybeIncorrect`. Details: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Should.20.60filter_map_identity.60.20lint.20when.20closures.20are.20typed.3F
`Box::default()` had its `#[rustc_box]` attribute removed in 1.69 so is no longer a perf related lint The lint is moved to style but no longer produces suggestions containing turbofishes, as they're often longer/more annoying to type
☔ The latest upstream changes (presumably #12453) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #12564
changelog: Fix [
manual_unwrap_or_default
] false positive when initialmatch
/if let
condition doesn't implementDefault
but the return type does.