]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #74605 - rust-lang:vec-leak, r=Amanieu
authorbors <bors@rust-lang.org>
Sat, 1 Aug 2020 22:29:30 +0000 (22:29 +0000)
committerbors <bors@rust-lang.org>
Sat, 1 Aug 2020 22:29:30 +0000 (22:29 +0000)
Stabilize Vec::leak as a method

Closes https://github.com/rust-lang/rust/issues/62195

The signature is changed to a method rather than an associated function:

```diff
-pub fn leak<'a>(vec: Vec<T>) -> &'a mut [T]
+pub fn leak<'a>(self) -> &'a mut [T]
```

The reason for `Box::leak` not to be a method (`Deref` to an arbitrary `T` which might have its own, different `leak` method) does not apply.


Trivial merge