diff options
| author | hkalbasi <hamidrezakalbasi@protonmail.com> | 2023-04-23 21:55:47 +0330 |
|---|---|---|
| committer | hkalbasi <hamidrezakalbasi@protonmail.com> | 2023-04-23 21:55:47 +0330 |
| commit | 232f293c19700d21931cdea0a6c4afac97e77002 (patch) | |
| tree | 06fb17e370259e116ece92d8be1f704aad0c9df0 /crates/test-utils | |
| parent | 2feabc4dc462644287372922928110eea4c60ca7 (diff) | |
| download | rust-232f293c19700d21931cdea0a6c4afac97e77002.tar.gz rust-232f293c19700d21931cdea0a6c4afac97e77002.zip | |
Fix some typos in `StructFlags`
Diffstat (limited to 'crates/test-utils')
| -rw-r--r-- | crates/test-utils/src/minicore.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/test-utils/src/minicore.rs b/crates/test-utils/src/minicore.rs index 2f0c086092e..ca1dbf532c3 100644 --- a/crates/test-utils/src/minicore.rs +++ b/crates/test-utils/src/minicore.rs @@ -31,6 +31,7 @@ //! infallible: //! iterator: option //! iterators: iterator, fn +//! manually_drop: drop //! non_zero: //! option: panic //! ord: eq, option @@ -194,6 +195,30 @@ pub mod convert { // region:drop pub mod mem { + // region:manually_drop + #[lang = "manually_drop"] + #[repr(transparent)] + pub struct ManuallyDrop<T: ?Sized> { + value: T, + } + + impl<T> ManuallyDrop<T> { + pub const fn new(value: T) -> ManuallyDrop<T> { + ManuallyDrop { value } + } + } + + // region:deref + impl<T: ?Sized> crate::ops::Deref for ManuallyDrop<T> { + type Target = T; + fn deref(&self) -> &T { + &self.value + } + } + // endregion:deref + + // endregion:manually_drop + pub fn drop<T>(_x: T) {} } // endregion:drop |
