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
..
2020-09-28 14:51:03 -04:00
2020-09-12 10:38:33 -05:00
2020-09-12 10:38:33 -05:00
2020-10-27 17:02:42 +01:00
2020-08-21 19:31:00 +02:00
2020-10-27 14:45:02 -03:00
2020-08-21 00:25:25 +02:00
2020-10-26 22:39:43 +08:00