diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-10 08:41:48 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-10 08:41:48 -0800 |
| commit | 24c92134ea8e51aeb2264f171eb2847b1909fc3e (patch) | |
| tree | c3c76e20735e73f0dd5da4540e2b81514dbbf1e0 /src/test/codegen/stack-alloc-string-slice.rs | |
| parent | 6e6bea6e074afb8c84c939a83b884585345ecf4f (diff) | |
| parent | 4f61e160326676cdcce94b9d5bca7d88c5f40ee9 (diff) | |
| download | rust-24c92134ea8e51aeb2264f171eb2847b1909fc3e.tar.gz rust-24c92134ea8e51aeb2264f171eb2847b1909fc3e.zip | |
rollup merge of #22065: bluss/range-size-hint
When self.start > self.end, these iterators simply return None, so we adjust the size_hint to just return zero in this case. Certain optimizations can be implemented in and outside libstd if we know we can trust the size_hint for all inputs to for example Range<usize>. This corrects the ExactSizeIterator implementations, which IMO were unsound and incorrect previously, since they allowed a range like (2..1) to return a size_hint of -1us in when debug assertions are turned off.
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.rs')
0 files changed, 0 insertions, 0 deletions
