diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2023-07-22 06:34:13 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2023-07-22 06:34:13 +0000 |
| commit | bd1e4eeaeaba6bfb67c07af3ccb5241cf80bc431 (patch) | |
| tree | 2be01ed59bba85f4bdfe6c2f9d49856e7cf0b039 /library/alloc/src/sync.rs | |
| parent | 6e3932e10d02c68d2013e3f6c889a95ec588f28f (diff) | |
| parent | 7ac0ef9d1164fdb744f3f3c2f4a6893ed06cbe73 (diff) | |
| download | rust-bd1e4eeaeaba6bfb67c07af3ccb5241cf80bc431.tar.gz rust-bd1e4eeaeaba6bfb67c07af3ccb5241cf80bc431.zip | |
Merge from rustc
Diffstat (limited to 'library/alloc/src/sync.rs')
| -rw-r--r-- | library/alloc/src/sync.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index e00850eb5d8..c2202f2fce5 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -678,10 +678,14 @@ impl<T> Arc<T> { impl<T, A: Allocator> Arc<T, A> { /// Returns a reference to the underlying allocator. + /// + /// Note: this is an associated function, which means that you have + /// to call it as `Arc::allocator(&a)` instead of `a.allocator()`. This + /// is so that there is no conflict with a method on the inner type. #[inline] #[unstable(feature = "allocator_api", issue = "32838")] - pub fn allocator(&self) -> &A { - &self.alloc + pub fn allocator(this: &Self) -> &A { + &this.alloc } /// Constructs a new `Arc<T>` in the provided allocator. /// |
