Implement pinned borrows, part of pin_ergonomics

This commit is contained in:
Frank King
2025-01-19 22:01:11 +08:00
parent 49a8ba0684
commit e627f88f88
18 changed files with 471 additions and 18 deletions

View File

@@ -898,6 +898,10 @@ pub enum BorrowKind {
/// The resulting type is either `*const T` or `*mut T`
/// where `T = typeof($expr)`.
Raw,
/// A pinned borrow, `&pin const $expr` or `&pin mut $expr`.
/// The resulting type is either `Pin<&'a T>` or `Pin<&'a mut T>`
/// where `T = typeof($expr)` and `'a` is some lifetime.
Pin,
}
#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic)]