about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/mod.rs
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-10-19 23:58:42 +0200
committerMara Bos <m-ou.se@m-ou.se>2020-10-20 00:11:40 +0200
commitd80f127a75017dcdc91f4535b26a668976e2cfc7 (patch)
tree1ebf475d384e1b50ab4f657720b308443d16faa0 /compiler/rustc_mir/src/transform/coverage/mod.rs
parentad268bd63894953ab7038f082aa744d6a832639b (diff)
downloadrust-d80f127a75017dcdc91f4535b26a668976e2cfc7.tar.gz
rust-d80f127a75017dcdc91f4535b26a668976e2cfc7.zip
Avoid panic_bounds_check in fmt::write.
Writing any fmt::Arguments would trigger the inclusion of usize
formatting and padding code in the resulting binary, because indexing
used in fmt::write would generate code using panic_bounds_check, which
prints the index and length.

These bounds checks are not necessary, as fmt::Arguments never contains
any out-of-bounds indexes.

This change replaces them with unsafe get_unchecked, to reduce the
amount of generated code, which is especially important for embedded
targets.
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions