mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 02:29:44 +00:00
fix: Support unstable UnsafePinned struct in type layout calc
This commit is contained in:
parent
66e3b5819e
commit
d16b862ea5
5 changed files with 16 additions and 14 deletions
|
|
@ -345,6 +345,7 @@ language_item_table! {
|
|||
IndexMut, sym::index_mut, index_mut_trait, Target::Trait, GenericRequirement::Exact(1);
|
||||
|
||||
UnsafeCell, sym::unsafe_cell, unsafe_cell_type, Target::Struct, GenericRequirement::None;
|
||||
UnsafePinned, sym::unsafe_pinned, unsafe_pinned_type, Target::Struct, GenericRequirement::None;
|
||||
VaList, sym::va_list, va_list, Target::Struct, GenericRequirement::None;
|
||||
|
||||
Deref, sym::deref, deref_trait, Target::Trait, GenericRequirement::Exact(0);
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ bitflags! {
|
|||
const IS_MANUALLY_DROP = 1 << 5;
|
||||
/// Indicates whether this struct is `UnsafeCell`.
|
||||
const IS_UNSAFE_CELL = 1 << 6;
|
||||
/// Indicates whether this struct is `UnsafePinned`.
|
||||
const IS_UNSAFE_PINNED = 1 << 7;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -84,6 +86,7 @@ impl StructSignature {
|
|||
LangItem::OwnedBox => flags |= StructFlags::IS_BOX,
|
||||
LangItem::ManuallyDrop => flags |= StructFlags::IS_MANUALLY_DROP,
|
||||
LangItem::UnsafeCell => flags |= StructFlags::IS_UNSAFE_CELL,
|
||||
LangItem::UnsafePinned => flags |= StructFlags::IS_UNSAFE_PINNED,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue