-
Notifications
You must be signed in to change notification settings - Fork 13.3k
clippy::complexity fixes #116209
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
clippy::complexity fixes #116209
Conversation
match_single_binding needless_question_mark redundant_slicing derivable_impls filter_next
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
.find(filter_array_elements(tcx, query.param_env)) | ||
.is_some(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.find(filter_array_elements(tcx, query.param_env)) | |
.is_some(); | |
.any(filter_array_elements(tcx, query.param_env)); |
.find(filter_array_elements(tcx, query.param_env)) | ||
.is_some(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.find(filter_array_elements(tcx, query.param_env)) | |
.is_some(); | |
.any(filter_array_elements(tcx, query.param_env)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error[E0277]: expected a `std::ops::FnMut<(Result<rustc_middle::ty::Ty<'tcx>, AlwaysRequiresDrop>,)>` closure, found `impl for<'a> Fn(&'a Result<rustc_middle::ty::Ty<'_>, AlwaysRequiresDrop>) -> bool`
--> compiler/rustc_ty_utils/src/needs_drop.rs:58:10
|
58 | .any(filter_array_elements(tcx, query.param_env));
| --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut<(Result<rustc_middle::ty::Ty<'tcx>, AlwaysRequiresDrop>,)>` closure, found `impl for<'a> Fn(&'a Result<rustc_middle::ty::Ty<'_>, AlwaysRequiresDrop>) -> bool`
| |
| required by a bound introduced by this call
|
= help: the trait `std::ops::FnMut<(Result<rustc_middle::ty::Ty<'tcx>, AlwaysRequiresDrop>,)>` is not implemented for `impl for<'a> Fn(&'a Result<rustc_middle::ty::Ty<'_>, AlwaysRequiresDrop>) -> bool`
= note: expected a closure with arguments `(&Result<rustc_middle::ty::Ty<'_>, AlwaysRequiresDrop>,)`
found a closure with arguments `(Result<rustc_middle::ty::Ty<'tcx>, AlwaysRequiresDrop>,)`
note: required by a bound in `std::iter::Iterator::any`
--> /home/matthias/vcs/github/rust/library/core/src/iter/traits/iterator.rs:2857:12
|
2854 | fn any<F>(&mut self, f: F) -> bool
| --- required by a bound in this associated function
...
2857 | F: FnMut(Self::Item) -> bool,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::any`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to fix it by introducing a closure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, just edit the signature of filter_array_elements
to take a Result<Ty<'tcx>, NeedsDrop>
rather than a &Result<..>
?
@rustbot author to address the comments above |
☔ The latest upstream changes (presumably #117692) made this pull request unmergeable. Please resolve the merge conflicts. |
@matthiaskrgr any updates on this? thanks |
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
match_single_binding
needless_question_mark
redundant_slicing
derivable_impls
filter_next