This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 5ef872f
committed
Auto merge of rust-lang#74605 - rust-lang:vec-leak, r=Amanieu
Stabilize Vec::leak as a method
Closes rust-lang#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.1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | | - | |
1514 | | - | |
1515 | 1513 | | |
1516 | | - | |
| 1514 | + | |
1517 | 1515 | | |
1518 | 1516 | | |
1519 | 1517 | | |
1520 | | - | |
| 1518 | + | |
1521 | 1519 | | |
1522 | | - | |
| 1520 | + | |
1523 | 1521 | | |
1524 | 1522 | | |
1525 | 1523 | | |
1526 | | - | |
| 1524 | + | |
1527 | 1525 | | |
1528 | 1526 | | |
1529 | 1527 | | |
| |||
0 commit comments