about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorJosh Stone <cuviper@gmail.com>2020-03-22 16:03:34 -0700
committerJosh Stone <cuviper@gmail.com>2020-03-24 12:15:15 -0700
commit212e6ce7bf67d6475ec4fdfebfcf9f99704b2aa2 (patch)
tree2baa6bbd30a1438c0977170470529d128f36409b /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent2dcf54f564c6d8bbf48960fb9aaec88a0e2e062a (diff)
downloadrust-212e6ce7bf67d6475ec4fdfebfcf9f99704b2aa2.tar.gz
rust-212e6ce7bf67d6475ec4fdfebfcf9f99704b2aa2.zip
Implement Fuse with Option
The former `done` flag was roughly similar to an `Option` tag, but left
the possibity of misuse. By using a real `Option`, we can set `None`
when the iterator is exhausted, removing any way to call it again. We
also allow niche layout this way, so the `Fuse` may be smaller.

The `FusedIterator` specialization does want to ignore the possibility
of exhaustion though, so it uses `unsafe { intrinsics::unreachable() }`
to optimize that branch away. The entire `Fuse` implementation is now
isolated in its own module to contain that unsafety.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions