Skip to content

Commit

Permalink
Rollup merge of #95965 - CAD97:const-weak-new, r=workingjubilee
Browse files Browse the repository at this point in the history
Stabilize const-weak-new

This is a fairly uncontroversial library stabilization, so I'm going ahead and proposing it to ride the trains to stable.

This stabilizes the following APIs, which are defined to be non-allocating constructors.

```rust
// alloc::rc
impl<T> Weak<T> {
    pub const fn new() -> Weak<T>;
}

// alloc::sync
impl<T> Weak<T> {
    pub const fn new() -> Weak<T>;
}
```

Closes #95091

``@rustbot`` modify labels: +needs-fcp
  • Loading branch information
workingjubilee committed Jul 31, 2023
2 parents d4145ee + ee29d2f commit e5a6e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,7 @@ impl<T> Weak<T> {
/// ```
#[inline]
#[stable(feature = "downgraded_weak", since = "1.10.0")]
#[rustc_const_unstable(feature = "const_weak_new", issue = "95091", reason = "recently added")]
#[rustc_const_stable(feature = "const_weak_new", since = "CURRENT_RUSTC_VERSION")]
#[must_use]
pub const fn new() -> Weak<T> {
Weak {
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2503,7 +2503,7 @@ impl<T> Weak<T> {
/// ```
#[inline]
#[stable(feature = "downgraded_weak", since = "1.10.0")]
#[rustc_const_unstable(feature = "const_weak_new", issue = "95091", reason = "recently added")]
#[rustc_const_stable(feature = "const_weak_new", since = "CURRENT_RUSTC_VERSION")]
#[must_use]
pub const fn new() -> Weak<T> {
Weak {
Expand Down

0 comments on commit e5a6e5c

Please sign in to comment.