-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Simplify some iterator combinators #105541
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo |
Is Clippy able to catch most of this stuff? :) |
No idea! |
17db951
to
9b32525
Compare
@leonardo-m no -- clippy doesn't trigger on this: fn main() {
let x = vec![()];
x.into_iter().flat_map(|_| Some(1)).next();
// ^ should probably suggest `find_map`.
} |
So |
In |
Note that there's also an |
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.
This is a well-deserved simplifications. A few complementary ideas.
compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
Outdated
Show resolved
Hide resolved
9b32525
to
6445e7b
Compare
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.
A few extra API nits and r=me.
compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
Outdated
Show resolved
Hide resolved
☔ The latest upstream changes (presumably #105752) made this pull request unmergeable. Please resolve the merge conflicts. |
6445e7b
to
2baee88
Compare
Addressed comments in @bors r=cjgillot |
…mpiler-errors Rollup of 8 pull requests Successful merges: - rust-lang#104748 (Ensure `lld` is supported with `download-ci-llvm`) - rust-lang#105541 (Simplify some iterator combinators) - rust-lang#106045 (default OOM handler: use non-unwinding panic, to match std handler) - rust-lang#106157 (Don't trim path for `unsafe_op_in_unsafe_fn` lints) - rust-lang#106353 (Reduce spans for `unsafe impl` errors) - rust-lang#106381 (Jsondoclint: Add `--verbose` and `--json-output` options) - rust-lang#106411 (rustdoc: remove legacy font-feature-settings CSS) - rust-lang#106414 (Add cuviper to the review rotation for libs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Saw a
flat_map().next()
instead of afind_map()
in some method probe code, so did a quick search for some similar usages.