diff options
| author | bors <bors@rust-lang.org> | 2023-11-24 09:21:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-24 09:21:23 +0000 |
| commit | f74f700952f105536446e415b8df8061bddfb25e (patch) | |
| tree | 273518c7ba950fad1e919d966b93132b8dff64ae /library/core/src | |
| parent | 8abf920985368264ed4d46e62e1730232e161292 (diff) | |
| parent | 98bae8195d7ca3d18a0e1cadd942b7e159ab4013 (diff) | |
| download | rust-f74f700952f105536446e415b8df8061bddfb25e.tar.gz rust-f74f700952f105536446e415b8df8061bddfb25e.zip | |
Auto merge of #118232 - matthiaskrgr:rollup-x8crvm0, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #116807 (Improve rewind documentation) - #117656 (Update windows-bindgen and define `INVALID_HANDLE_VALUE` ourselves) - #117940 (chore: remove unnecessary drop) - #118028 (Document behavior of `<dyn Any as Any>::type_id()`) - #118060 (Use an absolute path to the NUL device) - #118224 (Sort unstable items last in rustdoc, instead of first) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/any.rs | 5 | ||||
| -rw-r--r-- | library/core/src/cell.rs | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 8f5404d9713..22777fb078a 100644 --- a/library/core/src/any.rs +++ b/library/core/src/any.rs @@ -115,6 +115,11 @@ use crate::intrinsics; pub trait Any: 'static { /// Gets the `TypeId` of `self`. /// + /// If called on a `dyn Any` trait object + /// (or a trait object of a subtrait of `Any`), + /// this returns the `TypeId` of the underlying + /// concrete type, not that of `dyn Any` itself. + /// /// # Examples /// /// ``` diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 0978b3c9280..f10a82c5694 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -409,8 +409,7 @@ impl<T> Cell<T> { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn set(&self, val: T) { - let old = self.replace(val); - drop(old); + self.replace(val); } /// Swaps the values of two `Cell`s. |
