Skip to content

Commit f264577

Browse files
committed
Use smaller ints for bitflags
1 parent 0dddad0 commit f264577

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/rustc_data_structures/src/profiling.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ use parking_lot::RwLock;
101101
use smallvec::SmallVec;
102102

103103
bitflags::bitflags! {
104-
struct EventFilter: u32 {
104+
struct EventFilter: u16 {
105105
const GENERIC_ACTIVITIES = 1 << 0;
106106
const QUERY_PROVIDERS = 1 << 1;
107107
const QUERY_CACHE_HITS = 1 << 2;

compiler/rustc_middle/src/ty/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use super::{Destructor, FieldDef, GenericPredicates, Ty, TyCtxt, VariantDef, Var
2626

2727
bitflags! {
2828
#[derive(HashStable, TyEncodable, TyDecodable)]
29-
pub struct AdtFlags: u32 {
29+
pub struct AdtFlags: u16 {
3030
const NO_ADT_FLAGS = 0;
3131
/// Indicates whether the ADT is an enum.
3232
const IS_ENUM = 1 << 0;

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ pub struct Destructor {
17391739

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

compiler/rustc_target/src/abi/call/mod.rs

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

0 commit comments

Comments
 (0)