1
Fork 0

Use dedicated PreciseCapturingArg for representing what goes in use<>

This commit is contained in:
Michael Goulet 2024-04-03 21:47:02 -04:00
parent 647b672f16
commit fc9e344874
6 changed files with 146 additions and 56 deletions

View file

@ -2132,7 +2132,7 @@ pub enum TyKind {
/// The `NodeId` exists to prevent lowering from having to
/// generate `NodeId`s on the fly, which would complicate
/// the generation of opaque `type Foo = impl Trait` items significantly.
ImplTrait(NodeId, GenericBounds, Option<P<GenericArgs>>),
ImplTrait(NodeId, GenericBounds, Option<ThinVec<PreciseCapturingArg>>),
/// No-op; kept solely so that we can pretty-print faithfully.
Paren(P<Ty>),
/// Unused for now.
@ -2188,6 +2188,14 @@ pub enum TraitObjectSyntax {
None,
}
#[derive(Clone, PartialEq, Encodable, Decodable, Debug)]
pub enum PreciseCapturingArg {
/// Lifetime parameter
Lifetime(Lifetime),
/// Type or const parameter
Arg(Ident, NodeId),
}
/// Inline assembly operand explicit register or register class.
///
/// E.g., `"eax"` as in `asm!("mov eax, 2", out("eax") result)`.