diff options
| author | bors <bors@rust-lang.org> | 2021-12-29 02:49:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-29 02:49:34 +0000 |
| commit | 8e05bb527c5f00549ea6bc21352638200bceb1a5 (patch) | |
| tree | 17a3d48398a2acef9341636d5617a1d0d94573c7 /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs | |
| parent | 7ae550842635dce84811198446fe87e830de500b (diff) | |
| parent | 141c542052c1adec045136212a42f241ba3fb9a9 (diff) | |
| download | rust-8e05bb527c5f00549ea6bc21352638200bceb1a5.tar.gz rust-8e05bb527c5f00549ea6bc21352638200bceb1a5.zip | |
Auto merge of #92283 - vacuus:print-generic-bounds, r=camelid,GuillaumeGomez
rustdoc: Remove `String` allocation in iteration in `print_generic_bounds` (I realized only after making the commit that maybe I shouldn't refer to iteration as looping, but it's close enough) The string representation of a `clean::GenericBound` instance (evaluated [here](https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/format.rs#L397)) is deterministic for a given `self` (the instance), `cx` and `f`, and since `cx` and `f` are constant (as far as I can tell) for a given invocation of `print_generic_bounds`, `self` is the determining factor. Therefore, using the data in `self` shouldn't differ in effect from using its string representation. Given the totality of the function calls needed to evaluate the string representation as well as the actual allocation, at the very least, this shouldn't negatively affect performance.
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs')
0 files changed, 0 insertions, 0 deletions
