-
Notifications
You must be signed in to change notification settings - Fork 13.7k
gpu offload: change suspicious map into filter #146236
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
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
@@ -193,7 +193,7 @@ fn gen_define_handling<'ll>( | |||
// reference) types. | |||
let num_ptr_types = types | |||
.iter() | |||
.map(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer)) | |||
.filter(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer)) |
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.
Looks ok to me but I know nothing about this code and will offload the review to @ZuseZ4 as the original author.
Yes, that was wrong, thanks for your PR. I haven't ran any multi-argument testcases yet since I'm waiting for two of my GPU PRs to be reviewed and merged first, therefore I haven't noticed it yet. @bors r+ rollup |
Rollup of 4 pull requests Successful merges: - #146200 (Simplify rustdoc-gui tester by calling directly browser-ui-test) - #146236 (gpu offload: change suspicious map into filter) - #146240 (DynamicConfig: use canonical clone impl) - #146251 (rustc_middle: clippy fixes) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #146236 - hkBst:gpu-1, r=ZuseZ4 gpu offload: change suspicious map into filter Fixes clippy warning: ```text warning: this call to `map()` won't have an effect on the call to `count()` --> compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs:194:25 | 194 | let num_ptr_types = types | _________________________^ 195 | | .iter() 196 | | .map(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer)) 197 | | .count(); | |________________^ | = help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_map = note: `-W clippy::suspicious-map` implied by `-W clippy::suspicious` = help: to override `-W clippy::suspicious` add `#[allow(clippy::suspicious_map)]` ```
Fixes clippy warning: