about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/graph.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2021-11-25 18:27:36 -0800
committerDavid Tolnay <dtolnay@gmail.com>2021-11-25 18:27:40 -0800
commit9125dd74bdbd0c41d6f8341366992db514e56246 (patch)
tree08f4cca7edcdc579ee9c59ba1af5706a1966d5a9 /compiler/rustc_mir_transform/src/coverage/graph.rs
parentdd549dcab404ec4c7d07b5a83aca5bdd7171138f (diff)
downloadrust-9125dd74bdbd0c41d6f8341366992db514e56246.tar.gz
rust-9125dd74bdbd0c41d6f8341366992db514e56246.zip
Eliminate an unreachable codepath from String::from_utf8_lossy
Utf8Lossy's Iterator implementation ensures that only the final chunk
has an empty slice for broken. Thus the only way the first chunk could
have an empty broken is if it is the final chunk, i.e. there is only one
chunk total. And the only way that there could be one chunk total is if
the whole input is valid utf8 and non-empty. That condition has already
been handled by an early return, so at the point that the first
REPLACEMENT is being pushed, it's impossible for first_broken to be
empty.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions