Update to bitflags 2 in the compiler
This involves lots of breaking changes. There are two big changes that force changes. The first is that the bitflag types now don't automatically implement normal derive traits, so we need to derive them manually. Additionally, bitflags now have a hidden inner type by default, which breaks our custom derives. The bitflags docs recommend using the impl form in these cases, which I did.
This commit is contained in:
@@ -1771,9 +1771,10 @@ pub struct Destructor {
|
||||
pub constness: hir::Constness,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)]
|
||||
pub struct VariantFlags(u8);
|
||||
bitflags! {
|
||||
#[derive(HashStable, TyEncodable, TyDecodable)]
|
||||
pub struct VariantFlags: u8 {
|
||||
impl VariantFlags: u8 {
|
||||
const NO_VARIANT_FLAGS = 0;
|
||||
/// Indicates whether the field list of this variant is `#[non_exhaustive]`.
|
||||
const IS_FIELD_LIST_NON_EXHAUSTIVE = 1 << 0;
|
||||
@@ -1782,6 +1783,7 @@ bitflags! {
|
||||
const IS_RECOVERED = 1 << 1;
|
||||
}
|
||||
}
|
||||
rustc_data_structures::external_bitflags_debug! { VariantFlags }
|
||||
|
||||
/// Definition of a variant -- a struct's fields or an enum variant.
|
||||
#[derive(Debug, HashStable, TyEncodable, TyDecodable)]
|
||||
|
||||
Reference in New Issue
Block a user