Repository navigation
implement const Iterator for Range - #156216
Conversation
|
Another issue I noticed is that |
This comment has been minimized.
This comment has been minimized.
|
Does this run into #148200 for types that implement non-const |
This comment has been minimized.
This comment has been minimized.
|
@theemathas |
|
Maybe there's actually not a problem with specialization here? I suppose it's kind of fine to call a function that requires |
| #[stable(feature = "rust1", since = "1.0.0")] | ||
| impl<A: Step> DoubleEndedIterator for ops::Range<A> { | ||
| #[rustc_const_unstable(feature = "const_iter", issue = "92476")] | ||
| impl<A: [const] Step + [const] Destruct> const DoubleEndedIterator for ops::Range<A> { |
There was a problem hiding this comment.
Is this change needed for the MVP? should at least be a separate commit unless the rest of this commit requires it
There was a problem hiding this comment.
It is, in fact, required since last() is implemented using next_back(), so it needs to be constified too.
|
I feel iffy on introducing additional const impls that use specialization without us fixing specialization first |
|
This no longer builds since bc2112e. Probably related to a88521a. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Looks like genuine ICE for me, I may take a look at it tomorrow |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
implement const Iterator for Range This allows the use of `for i in i..n` in `const`. This I believe is interesting enough to be justified under rust-lang#155816 r? @oli-obk
Rollup of 7 pull requests Successful merges: - #156216 (implement const Iterator for Range) - #162748 (Enable LLVM Thin LTO for LoongArch64) - #162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - #162800 (Cleanups related to RefDecodable) - #162826 (wasm: fix ABI for enums with integer layout and ZST fields) - #159359 ([rustc_public] Enhance PassMode API) - #162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Rollup of 10 pull requests Successful merges: - #156216 (implement const Iterator for Range) - #160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism) - #162748 (Enable LLVM Thin LTO for LoongArch64) - #162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - #162794 (Simplify `ast::UseTreeKind`) - #162800 (Cleanups related to RefDecodable) - #162826 (wasm: fix ABI for enums with integer layout and ZST fields) - #159359 ([rustc_public] Enhance PassMode API) - #162196 (Offload cmake cleanups) - #162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Rollup of 10 pull requests Successful merges: - rust-lang/rust#156216 (implement const Iterator for Range) - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism) - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64) - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`) - rust-lang/rust#162800 (Cleanups related to RefDecodable) - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields) - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API) - rust-lang/rust#162196 (Offload cmake cleanups) - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Rollup of 10 pull requests Successful merges: - rust-lang/rust#156216 (implement const Iterator for Range) - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism) - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64) - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`) - rust-lang/rust#162800 (Cleanups related to RefDecodable) - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields) - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API) - rust-lang/rust#162196 (Offload cmake cleanups) - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Rollup of 10 pull requests Successful merges: - rust-lang/rust#156216 (implement const Iterator for Range) - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism) - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64) - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`) - rust-lang/rust#162800 (Cleanups related to RefDecodable) - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields) - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API) - rust-lang/rust#162196 (Offload cmake cleanups) - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Rollup of 10 pull requests Successful merges: - rust-lang#156216 (implement const Iterator for Range) - rust-lang#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism) - rust-lang#162748 (Enable LLVM Thin LTO for LoongArch64) - rust-lang#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - rust-lang#162794 (Simplify `ast::UseTreeKind`) - rust-lang#162800 (Cleanups related to RefDecodable) - rust-lang#162826 (wasm: fix ABI for enums with integer layout and ZST fields) - rust-lang#159359 ([rustc_public] Enhance PassMode API) - rust-lang#162196 (Offload cmake cleanups) - rust-lang#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Rollup of 10 pull requests Successful merges: - rust-lang/rust#156216 (implement const Iterator for Range) - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism) - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64) - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`)) - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`) - rust-lang/rust#162800 (Cleanups related to RefDecodable) - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields) - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API) - rust-lang/rust#162196 (Offload cmake cleanups) - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
…ohnTitor,JonathanBrouwer Revert "implement const Iterator for Range - rust-lang#156216" Potential fix for rust-lang#166229. Had to manually resolve some merge conflicts, but, range-diff does appear to verify that this does fully revert the original PR rust-lang#156216.
…uwer Rollup of 12 pull requests Successful merges: - #166340 (Revert "implement const Iterator for Range - #156216") - #165345 (Remove the 'eq', 'eq_trace', and 'goals_to_obligations' methods from 'At') - #165538 (Supertraits returns Unnormalized) - #165794 (`consider_impl_candidate` tweaks) - #160752 (Avoid inference constraints from opaque blanket impls) - #163187 (add `scalbn` and `ilogb` methods on floats) - #164541 (Add regression test for #152415) - #164543 (Add regression test for #151316) - #165920 (Introduce compute_abi helper and ComputeCallConv trait) - #166313 (Move `rustdoc-ui` tests in the right folder) - #166420 ([rustdoc] Fix search index generation: if crate content didn't change, it should generate the same search index) - #166485 (Allow passing `--exact-match` and `--purge` to `x perf`)
Rollup merge of #166340 - clarfonthey:revert-iter-range, r=JohnTitor,JonathanBrouwer Revert "implement const Iterator for Range - #156216" Potential fix for #166229. Had to manually resolve some merge conflicts, but, range-diff does appear to verify that this does fully revert the original PR #156216.
[stable] prepare Rust 1.100.1 * #166340 * This was done through a clean revert of #156216, rather than a cherry-pick of #166340, because that had significant conflicts * #165997 * This had an easily resolved merge conflict as well r? @cuviper @clarfonthey cc @rust-lang/release
[stable] prepare Rust 1.100.1 * #166340 * This was done through a clean revert of #156216, rather than a cherry-pick of #166340, because that had significant conflicts * #165997 * This had an easily resolved merge conflict as well * #166302 r? @cuviper @clarfonthey cc @rust-lang/release
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#166340 (Revert "implement const Iterator for Range - rust-lang/rust#156216") - rust-lang/rust#165345 (Remove the 'eq', 'eq_trace', and 'goals_to_obligations' methods from 'At') - rust-lang/rust#165538 (Supertraits returns Unnormalized) - rust-lang/rust#165794 (`consider_impl_candidate` tweaks) - rust-lang/rust#160752 (Avoid inference constraints from opaque blanket impls) - rust-lang/rust#163187 (add `scalbn` and `ilogb` methods on floats) - rust-lang/rust#164541 (Add regression test for rust-lang/rust#152415) - rust-lang/rust#164543 (Add regression test for rust-lang/rust#151316) - rust-lang/rust#165920 (Introduce compute_abi helper and ComputeCallConv trait) - rust-lang/rust#166313 (Move `rustdoc-ui` tests in the right folder) - rust-lang/rust#166420 ([rustdoc] Fix search index generation: if crate content didn't change, it should generate the same search index) - rust-lang/rust#166485 (Allow passing `--exact-match` and `--purge` to `x perf`)
[stable] prepare Rust 1.100.1 * #166340 * This was done through a clean revert of #156216, rather than a cherry-pick of #166340, because that had significant conflicts * #165997 * This had an easily resolved merge conflict as well * #166302 r? @cuviper @clarfonthey cc @rust-lang/release
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#166340 (Revert "implement const Iterator for Range - rust-lang/rust#156216") - rust-lang/rust#165345 (Remove the 'eq', 'eq_trace', and 'goals_to_obligations' methods from 'At') - rust-lang/rust#165538 (Supertraits returns Unnormalized) - rust-lang/rust#165794 (`consider_impl_candidate` tweaks) - rust-lang/rust#160752 (Avoid inference constraints from opaque blanket impls) - rust-lang/rust#163187 (add `scalbn` and `ilogb` methods on floats) - rust-lang/rust#164541 (Add regression test for rust-lang/rust#152415) - rust-lang/rust#164543 (Add regression test for rust-lang/rust#151316) - rust-lang/rust#165920 (Introduce compute_abi helper and ComputeCallConv trait) - rust-lang/rust#166313 (Move `rustdoc-ui` tests in the right folder) - rust-lang/rust#166420 ([rustdoc] Fix search index generation: if crate content didn't change, it should generate the same search index) - rust-lang/rust#166485 (Allow passing `--exact-match` and `--purge` to `x perf`)
View all comments
This allows the use of
for i in i..ninconst.This I believe is interesting enough to be justified under #155816
r? @oli-obk