Simplify option-iterator flattening in the compiler#158627
Conversation
In many cases where we are flattening `option::IntoIter<I>`, we can use `into_flat_iter()` instead for a simpler implementation.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Simplify option-iterator flattening in the compiler
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (118fe6f): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (primary 2.3%, secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 485.565s -> 488.649s (0.64%) |
|
Of course I hoped for more of a perf improvement, but at least it's not bad. :) |
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in coverage instrumentation. cc @Zalathar |
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@bors r+ |
…, r=nnethercote Simplify option-iterator flattening in the compiler In many cases where we are flattening `option::IntoIter<I>`, we can use `Option::into_flat_iter()` instead for a simpler implementation. A few other cases have more direct constructs available.
Rollup of 5 pull requests Successful merges: - #155429 (Support `u128`/`i128` c-variadic arguments) - #158627 (Simplify option-iterator flattening in the compiler) - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`) - #158674 (library: Polish transmute's `split_at_stdlib` example) - #158682 (Avoid delayed bug for disabled on_type_error arguments)
…, r=nnethercote Simplify option-iterator flattening in the compiler In many cases where we are flattening `option::IntoIter<I>`, we can use `Option::into_flat_iter()` instead for a simpler implementation. A few other cases have more direct constructs available.
…uwer Rollup of 22 pull requests Successful merges: - #155429 (Support `u128`/`i128` c-variadic arguments) - #158100 (Emit retags in codegen to support BorrowSanitizer (part 4)) - #158494 (Improve E0277 diagnostics for conditionally implemented traits) - #158606 (use ProjectionPredicate instead of AliasRelate) - #158627 (Simplify option-iterator flattening in the compiler) - #158658 (Update LLVM submodule) - #158665 (Revert "Remove redundant dyn-compatibility check.") - #158021 (Remove old MinGW workaround) - #158473 (Add `riscv32imfc-unknown-none-elf` bare-metal target) - #158549 (process::exec: using appropriate exit code on vxworks.) - #158585 (Improve diagnostic for too many super keywords) - #158637 (hir_ty_lowering: avoid self type lookup for inherent aliases) - #158651 (ptr doc: reduce use of unsafe block to where needed) - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`) - #158674 (library: Polish transmute's `split_at_stdlib` example) - #158677 (Add extra splat tests) - #158680 (Avoid ICE for `NonZero<char>` in improper_ctypes) - #158681 (Remove unnecessary `Hash` derives from MIR types) - #158682 (Avoid delayed bug for disabled on_type_error arguments) - #158684 (Add missing generic test coverage for ```#[splat]```) - #158687 (Streamline `MacEager`) - #158688 (Cleanup attribute docs and add links to other mentioned attributes)
In many cases where we are flattening
option::IntoIter<I>, we can useOption::into_flat_iter()instead for a simpler implementation. A fewother cases have more direct constructs available.