rust/library/alloc
Jonas Schievink 48c4afbf9c
Rollup merge of #78499 - SkiFire13:fix-string-retain, r=m-ou-se
Prevent String::retain from creating non-utf8 strings when abusing panic

Fixes #78498

The idea is the same as `Vec::drain`, set the len to 0 so that nobody can observe the broken invariant if it escapes the function (in this case if `f` panics)
2020-10-29 17:05:28 +01:00
..
benches Rust vec bench import specific rand::RngCore 2020-09-25 22:19:28 +08:00
src Rollup merge of #78499 - SkiFire13:fix-string-retain, r=m-ou-se 2020-10-29 17:05:28 +01:00
tests Added test for issue #78498 2020-10-29 12:25:02 +01:00
Cargo.toml