-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Allow IndexSlice
to be indexed by ranges.
#136610
Conversation
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in coverage instrumentation. cc @Zalathar |
This comment was marked as resolved.
This comment was marked as resolved.
SliceIndex
to be indexed by ranges.IndexSlice
to be indexed by ranges.
I just realized I had a typo in the title; should have been |
I think there are various improvements that could be landed on master first before this PR (or just as commits before the currently only commit of this PR) |
bb61f03
to
8705084
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rustbot label -T-libs-api :) |
@bors r+ |
Allow `IndexSlice` to be indexed by ranges. This comes with some annoyances as the index type can no longer inferred from indexing expressions. The biggest offender for this is `IndexVec::from_fn_n(|idx| ..., n)` where the index type won't be inferred from the call site or any index expressions inside the closure. My main use case for this is mapping a `Place` to `Range<Idx>` for value tracking where the range represents all the values the place contains.
Rollup of 9 pull requests Successful merges: - rust-lang#131282 (std: detect stack overflows in TLS destructors on UNIX) - rust-lang#136610 (Allow `IndexSlice` to be indexed by ranges.) - rust-lang#136991 ([rustdoc] Add new setting to wrap source code lines when too long) - rust-lang#137393 (Stabilize `unbounded_shifts`) - rust-lang#137482 (Windows: use existing wrappers in `File::open_native`) - rust-lang#137484 (Fix documentation for unstable sort on slice) - rust-lang#137491 (Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling) - rust-lang#137495 (Added into_value function to ControlFlow<T, T>) - rust-lang#137501 (Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`) Failed merges: - rust-lang#137489 (remove `#[rustc_intrinsic_must_be_overridde]`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 10 pull requests Successful merges: - rust-lang#136610 (Allow `IndexSlice` to be indexed by ranges.) - rust-lang#136991 ([rustdoc] Add new setting to wrap source code lines when too long) - rust-lang#137061 (Unstable `gen_future` Feature Tracking ) - rust-lang#137393 (Stabilize `unbounded_shifts`) - rust-lang#137482 (Windows: use existing wrappers in `File::open_native`) - rust-lang#137484 (Fix documentation for unstable sort on slice) - rust-lang#137491 (Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling) - rust-lang#137495 (Added into_value function to ControlFlow<T, T>) - rust-lang#137501 (Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`) - rust-lang#137505 (Add a span to `CompilerBuiltinsCannotCall`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136610 - Jarcho:range_idx, r=Noratrieb Allow `IndexSlice` to be indexed by ranges. This comes with some annoyances as the index type can no longer inferred from indexing expressions. The biggest offender for this is `IndexVec::from_fn_n(|idx| ..., n)` where the index type won't be inferred from the call site or any index expressions inside the closure. My main use case for this is mapping a `Place` to `Range<Idx>` for value tracking where the range represents all the values the place contains.
This comes with some annoyances as the index type can no longer inferred from indexing expressions. The biggest offender for this is
IndexVec::from_fn_n(|idx| ..., n)
where the index type won't be inferred from the call site or any index expressions inside the closure.My main use case for this is mapping a
Place
toRange<Idx>
for value tracking where the range represents all the values the place contains.