Skip to content

Commit

Permalink
Rollup merge of #103153 - ChrisDenton:leak-oom, r=m-ou-se
Browse files Browse the repository at this point in the history
Allow `Vec::leak` when using `no_global_oom_handling`

As [the documentation notes](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.leak), `Vec::leak` hasn't allocated since 1.57.

cc `@Ericson2314` in case I'm missing something.
  • Loading branch information
Dylan-DPC authored Oct 19, 2022
2 parents 7a0bc95 + ef5d6f2 commit 84a0e80
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,6 @@ impl<T, A: Allocator> Vec<T, A> {
/// static_ref[0] += 1;
/// assert_eq!(static_ref, &[2, 2, 3]);
/// ```
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "vec_leak", since = "1.47.0")]
#[inline]
pub fn leak<'a>(self) -> &'a mut [T]
Expand Down

0 comments on commit 84a0e80

Please sign in to comment.