Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #73197 - c410-f3r:ranges, r=dtolnay
Impl Default for ranges Couldn't find an issue about it. `Range` and friends probably can implement `Default` if `Idx: Default`. For example, the following would be possible: ```rust #[derive(Default)] struct Foo(core::ops::RangeToInclusive<u64>); let _ = [1, 2, 3].get(core::ops::Range::default()); core::ops::RangeFrom::<u8>::default().take(20).for_each(|x| { dbg!(x); }); fn stuff<T: Default>() { let instance = T::default(); ... more stuff } stuff::<core::ops::RangeTo<f32>>(); ``` Maybe there are some concerns about safety or misunderstandings?
- Loading branch information