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:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-25 19:28:12 +0100
committerGitHub <noreply@github.com>2020-03-25 19:28:12 +0100
commit530c320e7534aa3ae1afbd6dbf423d5578c391f6 (patch)
treeed527a0ba103d7deae67dd66eee5fcab382c0a0f /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent3586ab615e40fdc5a0f2bb40d201753b1e36d875 (diff)
parent4f429c074b865e2ae7a4dc52eb6f2e5db9244e48 (diff)
downloadrust-530c320e7534aa3ae1afbd6dbf423d5578c391f6.tar.gz
rust-530c320e7534aa3ae1afbd6dbf423d5578c391f6.zip
Rollup merge of #70366 - cuviper:option-fuse, r=dtolnay
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.

r? @scottmcm
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions