about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2023-07-30 17:50:46 -0700
committerGitHub <noreply@github.com>2023-07-30 17:50:46 -0700
commite5a6e5c90dc1f025e5cf34af6c3a9f474f3b9e35 (patch)
tree1ea5ae3b5a550beaa7a3912a250e52ce41ac138d
parentd4145eeef476abee0faebf6649dc02c6a6440e1e (diff)
parentee29d2fd0a0b53f3460a9ffe67db6473e5913385 (diff)
downloadrust-e5a6e5c90dc1f025e5cf34af6c3a9f474f3b9e35.tar.gz
rust-e5a6e5c90dc1f025e5cf34af6c3a9f474f3b9e35.zip
Rollup merge of #95965 - CAD97:const-weak-new, r=workingjubilee
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
-rw-r--r--library/alloc/src/rc.rs2
-rw-r--r--library/alloc/src/sync.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index bf01b2082ed..60b07485c3a 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -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 {
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index c2202f2fce5..6c701225a84 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -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 {