summaryrefslogtreecommitdiffstats
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /library/std/src/thread
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/local.rs27
1 files changed, 9 insertions, 18 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index 1b86d898c..09994e47f 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -313,7 +313,6 @@ impl<T: 'static> LocalKey<Cell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::Cell;
///
/// thread_local! {
@@ -326,7 +325,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
///
/// assert_eq!(X.get(), 123);
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn set(&'static self, value: T) {
self.initialize_with(Cell::new(value), |value, cell| {
if let Some(value) = value {
@@ -351,7 +350,6 @@ impl<T: 'static> LocalKey<Cell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::Cell;
///
/// thread_local! {
@@ -360,7 +358,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
///
/// assert_eq!(X.get(), 1);
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn get(&'static self) -> T
where
T: Copy,
@@ -381,7 +379,6 @@ impl<T: 'static> LocalKey<Cell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::Cell;
///
/// thread_local! {
@@ -391,7 +388,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
/// assert_eq!(X.take(), Some(1));
/// assert_eq!(X.take(), None);
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn take(&'static self) -> T
where
T: Default,
@@ -412,7 +409,6 @@ impl<T: 'static> LocalKey<Cell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::Cell;
///
/// thread_local! {
@@ -422,7 +418,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
/// assert_eq!(X.replace(2), 1);
/// assert_eq!(X.replace(3), 2);
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn replace(&'static self, value: T) -> T {
self.with(|cell| cell.replace(value))
}
@@ -444,7 +440,6 @@ impl<T: 'static> LocalKey<RefCell<T>> {
/// # Example
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::RefCell;
///
/// thread_local! {
@@ -453,7 +448,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
///
/// X.with_borrow(|v| assert!(v.is_empty()));
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn with_borrow<F, R>(&'static self, f: F) -> R
where
F: FnOnce(&T) -> R,
@@ -476,7 +471,6 @@ impl<T: 'static> LocalKey<RefCell<T>> {
/// # Example
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::RefCell;
///
/// thread_local! {
@@ -487,7 +481,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
///
/// X.with_borrow(|v| assert_eq!(*v, vec![1]));
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn with_borrow_mut<F, R>(&'static self, f: F) -> R
where
F: FnOnce(&mut T) -> R,
@@ -511,7 +505,6 @@ impl<T: 'static> LocalKey<RefCell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::RefCell;
///
/// thread_local! {
@@ -524,7 +517,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
///
/// X.with_borrow(|v| assert_eq!(*v, vec![1, 2, 3]));
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn set(&'static self, value: T) {
self.initialize_with(RefCell::new(value), |value, cell| {
if let Some(value) = value {
@@ -551,7 +544,6 @@ impl<T: 'static> LocalKey<RefCell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::RefCell;
///
/// thread_local! {
@@ -566,7 +558,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
///
/// X.with_borrow(|v| assert!(v.is_empty()));
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn take(&'static self) -> T
where
T: Default,
@@ -586,7 +578,6 @@ impl<T: 'static> LocalKey<RefCell<T>> {
/// # Examples
///
/// ```
- /// #![feature(local_key_cell_methods)]
/// use std::cell::RefCell;
///
/// thread_local! {
@@ -598,7 +589,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
///
/// X.with_borrow(|v| assert_eq!(*v, vec![1, 2, 3]));
/// ```
- #[unstable(feature = "local_key_cell_methods", issue = "92122")]
+ #[stable(feature = "local_key_cell_methods", since = "1.73.0")]
pub fn replace(&'static self, value: T) -> T {
self.with(|cell| cell.replace(value))
}