Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lyons-kehl committed Dec 30, 2022
1 parent cc1f135 commit b7836cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ pub type WeVec<T, const weight: u8> = Vec<T, Global, { weight > 127 }>;
// Inherent methods
////////////////////////////////////////////////////////////////////////////////

impl<T> Vec<T> {
impl<T, const COOP_PREFERRED: bool> Vec<T, Global, COOP_PREFERRED>
where
[(); crate::co_alloc_metadata_num_slots_with_preference_global(COOP_PREFERRED)]:,
{
/// Constructs a new, empty `Vec<T>`.
///
/// The vector will not allocate until elements are pushed onto it.
Expand Down Expand Up @@ -3211,11 +3214,14 @@ where

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_default_impls", issue = "87864")]
impl<T> const Default for Vec<T> {
impl<T, const COOP_PREFERRED: bool> const Default for Vec<T, Global, COOP_PREFERRED>
where
[(); crate::co_alloc_metadata_num_slots_with_preference_global(COOP_PREFERRED)]:,
{
/// Creates an empty `Vec<T>`.
///
/// The vector will not allocate until elements are pushed onto it.
fn default() -> Vec<T> {
fn default() -> Vec<T, Global, COOP_PREFERRED> {
Vec::new()
}
}
Expand Down

0 comments on commit b7836cd

Please sign in to comment.