We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5f7653d + cb76e42 commit 07c4fb2Copy full SHA for 07c4fb2
library/std/src/io/error/repr_bitpacked.rs
@@ -235,7 +235,13 @@ impl Repr {
235
}
236
237
impl Drop for Repr {
238
- #[inline]
+ // This was #[inline] previously. Inlining the destructor of ErrorData is in
239
+ // no way helpful in real programs (as the source of the error will not be
240
+ // inlined, so there will not be any match assumptions to gain). The cost,
241
+ // meanwhile, is a code size increase by a factor of up to 5.4 in the case
242
+ // of dropping multiple io::Results in the same function
243
+ // (https://godbolt.org/z/8hfGchjsT).
244
+ #[inline(never)]
245
fn drop(&mut self) {
246
// Safety: We're a Repr, decode_repr is fine. The `Box::from_raw` is
247
// safe because we're being dropped.
0 commit comments