1
Fork 0

intern offsetof fields

This commit is contained in:
DrMeepster 2023-03-11 16:01:25 -08:00
parent 511e457c4b
commit 61f23e0003
8 changed files with 33 additions and 11 deletions

View file

@ -1115,7 +1115,7 @@ pub enum Rvalue<'tcx> {
CheckedBinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>)>),
/// Computes a value as described by the operation.
NullaryOp(NullOp, Ty<'tcx>),
NullaryOp(NullOp<'tcx>, Ty<'tcx>),
/// Exactly like `BinaryOp`, but less operands.
///
@ -1212,13 +1212,13 @@ pub enum AggregateKind<'tcx> {
}
#[derive(Clone, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
pub enum NullOp {
pub enum NullOp<'tcx> {
/// Returns the size of a value of that type
SizeOf,
/// Returns the minimum alignment of a type
AlignOf,
/// Returns the offset of a field
OffsetOf(Vec<FieldIdx>),
OffsetOf(&'tcx List<FieldIdx>),
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -1288,6 +1288,6 @@ mod size_asserts {
static_assert_size!(Operand<'_>, 24);
static_assert_size!(Place<'_>, 16);
static_assert_size!(PlaceElem<'_>, 24);
static_assert_size!(Rvalue<'_>, 48);
static_assert_size!(Rvalue<'_>, 40);
// tidy-alphabetical-end
}