Skip to content

Commit d68e6ed

Browse files
committed
Auto merge of rust-lang#147745 - matthiaskrgr:rollup-b4kftk9, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - rust-lang#143191 (Stabilize `rwlock_downgrade` library feature) - rust-lang#147444 (Allow printing a fully-qualified path in `def_path_str`) - rust-lang#147527 (Update t-compiler beta nomination Zulip msg) - rust-lang#147670 (some `ErrorGuaranteed` cleanups) - rust-lang#147676 (Return spans out of `is_doc_comment` to reduce reliance on `.span()` on attributes) - rust-lang#147708 (const `mem::drop`) - rust-lang#147710 (Fix ICE when using contracts on async functions) - rust-lang#147716 (Fix some comments) - rust-lang#147718 (miri: use allocator_shim_contents codegen helper) - rust-lang#147729 (ignore boring locals when explaining why a borrow contains a point due to drop of a live local under polonius) - rust-lang#147742 (Revert unintentional whitespace changes to rustfmt-excluded file) r? `@ghost` `@rustbot` modify labels: rollup
2 parents dfc23a4 + d0d66ed commit d68e6ed

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

core/src/mem/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![stable(feature = "rust1", since = "1.0.0")]
77

88
use crate::alloc::Layout;
9-
use crate::marker::DiscriminantKind;
9+
use crate::marker::{Destruct, DiscriminantKind};
1010
use crate::panic::const_assert;
1111
use crate::{clone, cmp, fmt, hash, intrinsics, ptr};
1212

@@ -958,8 +958,13 @@ pub const fn replace<T>(dest: &mut T, src: T) -> T {
958958
/// [`RefCell`]: crate::cell::RefCell
959959
#[inline]
960960
#[stable(feature = "rust1", since = "1.0.0")]
961+
#[rustc_const_unstable(feature = "const_destruct", issue = "133214")]
961962
#[rustc_diagnostic_item = "mem_drop"]
962-
pub fn drop<T>(_x: T) {}
963+
pub const fn drop<T>(_x: T)
964+
where
965+
T: [const] Destruct,
966+
{
967+
}
963968

964969
/// Bitwise-copies a value.
965970
///

std/src/sync/nonpoison/rwlock.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
700700
///
701701
/// ```
702702
/// #![feature(nonpoison_rwlock)]
703-
/// #![feature(rwlock_downgrade)]
704703
///
705704
/// use std::sync::nonpoison::{RwLock, RwLockWriteGuard};
706705
///
@@ -719,7 +718,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
719718
///
720719
/// ```
721720
/// #![feature(nonpoison_rwlock)]
722-
/// #![feature(rwlock_downgrade)]
723721
///
724722
/// use std::sync::Arc;
725723
/// use std::sync::nonpoison::{RwLock, RwLockWriteGuard};
@@ -752,8 +750,7 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
752750
/// # let final_check = rw.read();
753751
/// # assert_eq!(*final_check, 3);
754752
/// ```
755-
#[unstable(feature = "rwlock_downgrade", issue = "128203")]
756-
// #[unstable(feature = "nonpoison_rwlock", issue = "134645")]
753+
#[unstable(feature = "nonpoison_rwlock", issue = "134645")]
757754
pub fn downgrade(s: Self) -> RwLockReadGuard<'rwlock, T> {
758755
let lock = s.lock;
759756

std/src/sync/poison/rwlock.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
813813
/// `downgrade` takes ownership of the `RwLockWriteGuard` and returns a [`RwLockReadGuard`].
814814
///
815815
/// ```
816-
/// #![feature(rwlock_downgrade)]
817-
///
818816
/// use std::sync::{RwLock, RwLockWriteGuard};
819817
///
820818
/// let rw = RwLock::new(0);
@@ -831,8 +829,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
831829
/// thread calling `downgrade` and any reads it performs after downgrading.
832830
///
833831
/// ```
834-
/// #![feature(rwlock_downgrade)]
835-
///
836832
/// use std::sync::{Arc, RwLock, RwLockWriteGuard};
837833
///
838834
/// let rw = Arc::new(RwLock::new(1));
@@ -863,7 +859,7 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
863859
/// # let final_check = rw.read().unwrap();
864860
/// # assert_eq!(*final_check, 3);
865861
/// ```
866-
#[unstable(feature = "rwlock_downgrade", issue = "128203")]
862+
#[stable(feature = "rwlock_downgrade", since = "CURRENT_RUSTC_VERSION")]
867863
pub fn downgrade(s: Self) -> RwLockReadGuard<'rwlock, T> {
868864
let lock = s.lock;
869865

std/tests/sync/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(once_cell_try)]
55
#![feature(lock_value_accessors)]
66
#![feature(reentrant_lock)]
7-
#![feature(rwlock_downgrade)]
87
#![feature(std_internals)]
98
#![feature(sync_nonpoison)]
109
#![feature(nonpoison_condvar)]

0 commit comments

Comments
 (0)