1
Fork 0

Use smaller ints for bitflags

This commit is contained in:
Nilstrieb 2023-04-30 19:08:46 +02:00
parent 0dddad0dc5
commit f2645776dc
4 changed files with 4 additions and 4 deletions

View file

@ -101,7 +101,7 @@ use parking_lot::RwLock;
use smallvec::SmallVec; use smallvec::SmallVec;
bitflags::bitflags! { bitflags::bitflags! {
struct EventFilter: u32 { struct EventFilter: u16 {
const GENERIC_ACTIVITIES = 1 << 0; const GENERIC_ACTIVITIES = 1 << 0;
const QUERY_PROVIDERS = 1 << 1; const QUERY_PROVIDERS = 1 << 1;
const QUERY_CACHE_HITS = 1 << 2; const QUERY_CACHE_HITS = 1 << 2;

View file

@ -26,7 +26,7 @@ use super::{Destructor, FieldDef, GenericPredicates, Ty, TyCtxt, VariantDef, Var
bitflags! { bitflags! {
#[derive(HashStable, TyEncodable, TyDecodable)] #[derive(HashStable, TyEncodable, TyDecodable)]
pub struct AdtFlags: u32 { pub struct AdtFlags: u16 {
const NO_ADT_FLAGS = 0; const NO_ADT_FLAGS = 0;
/// Indicates whether the ADT is an enum. /// Indicates whether the ADT is an enum.
const IS_ENUM = 1 << 0; const IS_ENUM = 1 << 0;

View file

@ -1739,7 +1739,7 @@ pub struct Destructor {
bitflags! { bitflags! {
#[derive(HashStable, TyEncodable, TyDecodable)] #[derive(HashStable, TyEncodable, TyDecodable)]
pub struct VariantFlags: u32 { pub struct VariantFlags: u8 {
const NO_VARIANT_FLAGS = 0; const NO_VARIANT_FLAGS = 0;
/// Indicates whether the field list of this variant is `#[non_exhaustive]`. /// Indicates whether the field list of this variant is `#[non_exhaustive]`.
const IS_FIELD_LIST_NON_EXHAUSTIVE = 1 << 0; const IS_FIELD_LIST_NON_EXHAUSTIVE = 1 << 0;

View file

@ -65,7 +65,7 @@ mod attr_impl {
// The subset of llvm::Attribute needed for arguments, packed into a bitfield. // The subset of llvm::Attribute needed for arguments, packed into a bitfield.
bitflags::bitflags! { bitflags::bitflags! {
#[derive(Default, HashStable_Generic)] #[derive(Default, HashStable_Generic)]
pub struct ArgAttribute: u16 { pub struct ArgAttribute: u8 {
const NoAlias = 1 << 1; const NoAlias = 1 << 1;
const NoCapture = 1 << 2; const NoCapture = 1 << 2;
const NonNull = 1 << 3; const NonNull = 1 << 3;