Skip to content

Commit d5f94b0

Browse files
authored
Rollup merge of rust-lang#102288 - mejrs:inner, r=compiler-errors
Suggest unwrapping `???<T>` if a method cannot be found on it but is present on `T`. This suggests various ways to get inside wrapper types if the method cannot be found on the wrapper type, but is present on the wrappee. For this PR, those wrapper types include `Localkey`, `MaybeUninit`, `RefCell`, `RwLock` and `Mutex`.
2 parents 2f2a6bf + d85e818 commit d5f94b0

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

core/src/cell.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ impl<T, const N: usize> Cell<[T; N]> {
614614
/// A mutable memory location with dynamically checked borrow rules
615615
///
616616
/// See the [module-level documentation](self) for more.
617+
#[cfg_attr(not(test), rustc_diagnostic_item = "RefCell")]
617618
#[stable(feature = "rust1", since = "1.0.0")]
618619
pub struct RefCell<T: ?Sized> {
619620
borrow: Cell<BorrowFlag>,

std/src/sync/rwlock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ use crate::sys_common::rwlock as sys;
7676
///
7777
/// [`Mutex`]: super::Mutex
7878
#[stable(feature = "rust1", since = "1.0.0")]
79+
#[cfg_attr(not(test), rustc_diagnostic_item = "RwLock")]
7980
pub struct RwLock<T: ?Sized> {
8081
inner: sys::MovableRwLock,
8182
poison: poison::Flag,

std/src/thread/local.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ use crate::fmt;
9595
/// [loader lock]: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices
9696
/// [`JoinHandle::join`]: crate::thread::JoinHandle::join
9797
/// [`with`]: LocalKey::with
98+
#[cfg_attr(not(test), rustc_diagnostic_item = "LocalKey")]
9899
#[stable(feature = "rust1", since = "1.0.0")]
99100
pub struct LocalKey<T: 'static> {
100101
// This outer `LocalKey<T>` type is what's going to be stored in statics,

0 commit comments

Comments
 (0)