mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Fix some typos in StructFlags
This commit is contained in:
parent
2feabc4dc4
commit
232f293c19
5 changed files with 84 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue