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:
parent
d59f06fc64
commit
ffafcd8819
32 changed files with 132 additions and 139 deletions
32
Cargo.lock
32
Cargo.lock
|
@ -285,9 +285,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "2.4.0"
|
version = "2.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
|
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-buffer"
|
name = "block-buffer"
|
||||||
|
@ -3370,7 +3370,7 @@ dependencies = [
|
||||||
name = "rustc_abi"
|
name = "rustc_abi"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"rand",
|
"rand",
|
||||||
"rand_xoshiro",
|
"rand_xoshiro",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
|
@ -3401,7 +3401,7 @@ dependencies = [
|
||||||
name = "rustc_ast"
|
name = "rustc_ast"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"memchr",
|
"memchr",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
"rustc_index",
|
"rustc_index",
|
||||||
|
@ -3552,7 +3552,7 @@ dependencies = [
|
||||||
name = "rustc_codegen_llvm"
|
name = "rustc_codegen_llvm"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"itertools",
|
"itertools",
|
||||||
"libc",
|
"libc",
|
||||||
"measureme",
|
"measureme",
|
||||||
|
@ -3587,7 +3587,7 @@ name = "rustc_codegen_ssa"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ar_archive_writer",
|
"ar_archive_writer",
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"cc",
|
"cc",
|
||||||
"itertools",
|
"itertools",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
|
@ -3654,7 +3654,7 @@ name = "rustc_data_structures"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"elsa",
|
"elsa",
|
||||||
"ena",
|
"ena",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
@ -4121,7 +4121,7 @@ dependencies = [
|
||||||
name = "rustc_metadata"
|
name = "rustc_metadata"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"libloading 0.7.4",
|
"libloading 0.7.4",
|
||||||
"odht",
|
"odht",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
|
@ -4151,7 +4151,7 @@ dependencies = [
|
||||||
name = "rustc_middle"
|
name = "rustc_middle"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
"either",
|
"either",
|
||||||
"field-offset",
|
"field-offset",
|
||||||
|
@ -4286,7 +4286,7 @@ dependencies = [
|
||||||
name = "rustc_parse"
|
name = "rustc_parse"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
"rustc_ast_pretty",
|
"rustc_ast_pretty",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
|
@ -4424,7 +4424,7 @@ dependencies = [
|
||||||
name = "rustc_resolve"
|
name = "rustc_resolve"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"pulldown-cmark",
|
"pulldown-cmark",
|
||||||
"rustc_arena",
|
"rustc_arena",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
|
@ -4463,7 +4463,7 @@ dependencies = [
|
||||||
name = "rustc_session"
|
name = "rustc_session"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"getopts",
|
"getopts",
|
||||||
"libc",
|
"libc",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
|
@ -4521,7 +4521,7 @@ dependencies = [
|
||||||
name = "rustc_symbol_mangling"
|
name = "rustc_symbol_mangling"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"punycode",
|
"punycode",
|
||||||
"rustc-demangle",
|
"rustc-demangle",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
|
@ -4539,7 +4539,7 @@ dependencies = [
|
||||||
name = "rustc_target"
|
name = "rustc_target"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"object",
|
"object",
|
||||||
"rustc_abi",
|
"rustc_abi",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
|
@ -4638,7 +4638,7 @@ dependencies = [
|
||||||
name = "rustc_type_ir"
|
name = "rustc_type_ir"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 2.4.1",
|
||||||
"derivative",
|
"derivative",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
"rustc_index",
|
"rustc_index",
|
||||||
|
@ -4768,7 +4768,7 @@ version = "0.38.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
|
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.1",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
rand = { version = "0.8.4", default-features = false, optional = true }
|
rand = { version = "0.8.4", default-features = false, optional = true }
|
||||||
rand_xoshiro = { version = "0.6.0", optional = true }
|
rand_xoshiro = { version = "0.6.0", optional = true }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
|
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
|
||||||
|
|
|
@ -29,10 +29,12 @@ pub use layout::LayoutCalculator;
|
||||||
/// instead of implementing everything in `rustc_middle`.
|
/// instead of implementing everything in `rustc_middle`.
|
||||||
pub trait HashStableContext {}
|
pub trait HashStableContext {}
|
||||||
|
|
||||||
bitflags! {
|
#[derive(Clone, Copy, PartialEq, Eq, Default)]
|
||||||
#[derive(Default)]
|
|
||||||
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_Generic))]
|
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_Generic))]
|
||||||
pub struct ReprFlags: u8 {
|
pub struct ReprFlags(u8);
|
||||||
|
|
||||||
|
bitflags! {
|
||||||
|
impl ReprFlags: u8 {
|
||||||
const IS_C = 1 << 0;
|
const IS_C = 1 << 0;
|
||||||
const IS_SIMD = 1 << 1;
|
const IS_SIMD = 1 << 1;
|
||||||
const IS_TRANSPARENT = 1 << 2;
|
const IS_TRANSPARENT = 1 << 2;
|
||||||
|
@ -42,11 +44,12 @@ bitflags! {
|
||||||
// the seed stored in `ReprOptions.layout_seed`
|
// the seed stored in `ReprOptions.layout_seed`
|
||||||
const RANDOMIZE_LAYOUT = 1 << 4;
|
const RANDOMIZE_LAYOUT = 1 << 4;
|
||||||
// Any of these flags being set prevent field reordering optimisation.
|
// Any of these flags being set prevent field reordering optimisation.
|
||||||
const IS_UNOPTIMISABLE = ReprFlags::IS_C.bits
|
const IS_UNOPTIMISABLE = ReprFlags::IS_C.bits()
|
||||||
| ReprFlags::IS_SIMD.bits
|
| ReprFlags::IS_SIMD.bits()
|
||||||
| ReprFlags::IS_LINEAR.bits;
|
| ReprFlags::IS_LINEAR.bits();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { ReprFlags }
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_Generic))]
|
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_Generic))]
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
memchr = "2.5.0"
|
memchr = "2.5.0"
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
rustc_index = { path = "../rustc_index" }
|
rustc_index = { path = "../rustc_index" }
|
||||||
|
|
|
@ -2171,9 +2171,10 @@ pub enum InlineAsmRegOrRegClass {
|
||||||
RegClass(Symbol),
|
RegClass(Symbol),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)]
|
||||||
|
pub struct InlineAsmOptions(u16);
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[derive(Encodable, Decodable, HashStable_Generic)]
|
impl InlineAsmOptions: u16 {
|
||||||
pub struct InlineAsmOptions: u16 {
|
|
||||||
const PURE = 1 << 0;
|
const PURE = 1 << 0;
|
||||||
const NOMEM = 1 << 1;
|
const NOMEM = 1 << 1;
|
||||||
const READONLY = 1 << 2;
|
const READONLY = 1 << 2;
|
||||||
|
@ -2186,6 +2187,12 @@ bitflags::bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for InlineAsmOptions {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
bitflags::parser::to_writer(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic)]
|
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic)]
|
||||||
pub enum InlineAsmTemplatePiece {
|
pub enum InlineAsmTemplatePiece {
|
||||||
String(String),
|
String(String),
|
||||||
|
|
|
@ -8,7 +8,7 @@ test = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.0"
|
bitflags = "2.4.1"
|
||||||
itertools = "0.11"
|
itertools = "0.11"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
measureme = "10.0.0"
|
measureme = "10.0.0"
|
||||||
|
|
|
@ -722,7 +722,7 @@ pub mod debuginfo {
|
||||||
// These values **must** match with LLVMRustDIFlags!!
|
// These values **must** match with LLVMRustDIFlags!!
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[derive(Default)]
|
#[derive(Clone, Copy, Default)]
|
||||||
pub struct DIFlags: u32 {
|
pub struct DIFlags: u32 {
|
||||||
const FlagZero = 0;
|
const FlagZero = 0;
|
||||||
const FlagPrivate = 1;
|
const FlagPrivate = 1;
|
||||||
|
@ -751,7 +751,7 @@ pub mod debuginfo {
|
||||||
// These values **must** match with LLVMRustDISPFlags!!
|
// These values **must** match with LLVMRustDISPFlags!!
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[derive(Default)]
|
#[derive(Clone, Copy, Default)]
|
||||||
pub struct DISPFlags: u32 {
|
pub struct DISPFlags: u32 {
|
||||||
const SPFlagZero = 0;
|
const SPFlagZero = 0;
|
||||||
const SPFlagVirtual = 1;
|
const SPFlagVirtual = 1;
|
||||||
|
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
ar_archive_writer = "0.1.5"
|
ar_archive_writer = "0.1.5"
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
cc = "1.0.69"
|
cc = "1.0.69"
|
||||||
itertools = "0.11"
|
itertools = "0.11"
|
||||||
jobserver = "0.1.27"
|
jobserver = "0.1.27"
|
||||||
|
|
|
@ -110,6 +110,7 @@ pub enum ModuleKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub struct MemFlags: u8 {
|
pub struct MemFlags: u8 {
|
||||||
const VOLATILE = 1 << 0;
|
const VOLATILE = 1 << 0;
|
||||||
const NONTEMPORAL = 1 << 1;
|
const NONTEMPORAL = 1 << 1;
|
||||||
|
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
arrayvec = { version = "0.7", default-features = false }
|
arrayvec = { version = "0.7", default-features = false }
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
elsa = "=1.7.1"
|
elsa = "=1.7.1"
|
||||||
ena = "0.14.2"
|
ena = "0.14.2"
|
||||||
indexmap = { version = "2.0.0" }
|
indexmap = { version = "2.0.0" }
|
||||||
|
|
|
@ -150,3 +150,14 @@ pub fn make_display(f: impl Fn(&mut fmt::Formatter<'_>) -> fmt::Result) -> impl
|
||||||
// See comments in src/librustc_middle/lib.rs
|
// See comments in src/librustc_middle/lib.rs
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn __noop_fix_for_27438() {}
|
pub fn __noop_fix_for_27438() {}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! external_bitflags_debug {
|
||||||
|
($Name:ident) => {
|
||||||
|
impl ::std::fmt::Debug for $Name {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||||
|
::bitflags::parser::to_writer(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ use parking_lot::RwLock;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
struct EventFilter: u16 {
|
struct EventFilter: u16 {
|
||||||
const GENERIC_ACTIVITIES = 1 << 0;
|
const GENERIC_ACTIVITIES = 1 << 0;
|
||||||
const QUERY_PROVIDERS = 1 << 1;
|
const QUERY_PROVIDERS = 1 << 1;
|
||||||
|
@ -114,14 +115,14 @@ bitflags::bitflags! {
|
||||||
const INCR_RESULT_HASHING = 1 << 8;
|
const INCR_RESULT_HASHING = 1 << 8;
|
||||||
const ARTIFACT_SIZES = 1 << 9;
|
const ARTIFACT_SIZES = 1 << 9;
|
||||||
|
|
||||||
const DEFAULT = Self::GENERIC_ACTIVITIES.bits |
|
const DEFAULT = Self::GENERIC_ACTIVITIES.bits() |
|
||||||
Self::QUERY_PROVIDERS.bits |
|
Self::QUERY_PROVIDERS.bits() |
|
||||||
Self::QUERY_BLOCKED.bits |
|
Self::QUERY_BLOCKED.bits() |
|
||||||
Self::INCR_CACHE_LOADS.bits |
|
Self::INCR_CACHE_LOADS.bits() |
|
||||||
Self::INCR_RESULT_HASHING.bits |
|
Self::INCR_RESULT_HASHING.bits() |
|
||||||
Self::ARTIFACT_SIZES.bits;
|
Self::ARTIFACT_SIZES.bits();
|
||||||
|
|
||||||
const ARGS = Self::QUERY_KEYS.bits | Self::FUNCTION_ARGS.bits;
|
const ARGS = Self::QUERY_KEYS.bits() | Self::FUNCTION_ARGS.bits();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
libloading = "0.7.1"
|
libloading = "0.7.1"
|
||||||
odht = { version = "0.3.1", features = ["nightly"] }
|
odht = { version = "0.3.1", features = ["nightly"] }
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
derive_more = "0.99.17"
|
derive_more = "0.99.17"
|
||||||
either = "1.5.0"
|
either = "1.5.0"
|
||||||
field-offset = "0.3.5"
|
field-offset = "0.3.5"
|
||||||
|
|
|
@ -45,9 +45,10 @@ pub struct CodegenFnAttrs {
|
||||||
pub alignment: Option<u32>,
|
pub alignment: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, TyEncodable, TyDecodable, HashStable)]
|
||||||
|
pub struct CodegenFnAttrFlags(u32);
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(TyEncodable, TyDecodable, HashStable)]
|
impl CodegenFnAttrFlags: u32 {
|
||||||
pub struct CodegenFnAttrFlags: u32 {
|
|
||||||
/// `#[cold]`: a hint to LLVM that this function, when called, is never on
|
/// `#[cold]`: a hint to LLVM that this function, when called, is never on
|
||||||
/// the hot path.
|
/// the hot path.
|
||||||
const COLD = 1 << 0;
|
const COLD = 1 << 0;
|
||||||
|
@ -104,6 +105,7 @@ bitflags! {
|
||||||
const NO_BUILTINS = 1 << 20;
|
const NO_BUILTINS = 1 << 20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { CodegenFnAttrFlags }
|
||||||
|
|
||||||
impl CodegenFnAttrs {
|
impl CodegenFnAttrs {
|
||||||
pub const EMPTY: &'static Self = &Self::new();
|
pub const EMPTY: &'static Self = &Self::new();
|
||||||
|
|
|
@ -24,9 +24,10 @@ use std::str;
|
||||||
|
|
||||||
use super::{Destructor, FieldDef, GenericPredicates, Ty, TyCtxt, VariantDef, VariantDiscr};
|
use super::{Destructor, FieldDef, GenericPredicates, Ty, TyCtxt, VariantDef, VariantDiscr};
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, HashStable, TyEncodable, TyDecodable)]
|
||||||
|
pub struct AdtFlags(u16);
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(HashStable, TyEncodable, TyDecodable)]
|
impl AdtFlags: u16 {
|
||||||
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;
|
||||||
|
@ -51,6 +52,7 @@ bitflags! {
|
||||||
const IS_UNSAFE_CELL = 1 << 9;
|
const IS_UNSAFE_CELL = 1 << 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { AdtFlags }
|
||||||
|
|
||||||
/// The definition of a user-defined type, e.g., a `struct`, `enum`, or `union`.
|
/// The definition of a user-defined type, e.g., a `struct`, `enum`, or `union`.
|
||||||
///
|
///
|
||||||
|
|
|
@ -1771,9 +1771,10 @@ pub struct Destructor {
|
||||||
pub constness: hir::Constness,
|
pub constness: hir::Constness,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)]
|
||||||
|
pub struct VariantFlags(u8);
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(HashStable, TyEncodable, TyDecodable)]
|
impl VariantFlags: u8 {
|
||||||
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;
|
||||||
|
@ -1782,6 +1783,7 @@ bitflags! {
|
||||||
const IS_RECOVERED = 1 << 1;
|
const IS_RECOVERED = 1 << 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { VariantFlags }
|
||||||
|
|
||||||
/// Definition of a variant -- a struct's fields or an enum variant.
|
/// Definition of a variant -- a struct's fields or an enum variant.
|
||||||
#[derive(Debug, HashStable, TyEncodable, TyDecodable)]
|
#[derive(Debug, HashStable, TyEncodable, TyDecodable)]
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.0"
|
bitflags = "2.4.1"
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
|
|
|
@ -46,6 +46,7 @@ use crate::errors::{
|
||||||
};
|
};
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
struct Restrictions: u8 {
|
struct Restrictions: u8 {
|
||||||
const STMT_EXPR = 1 << 0;
|
const STMT_EXPR = 1 << 0;
|
||||||
const NO_STRUCT_LITERAL = 1 << 1;
|
const NO_STRUCT_LITERAL = 1 << 1;
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
pulldown-cmark = { version = "0.9.3", default-features = false }
|
pulldown-cmark = { version = "0.9.3", default-features = false }
|
||||||
rustc_arena = { path = "../rustc_arena" }
|
rustc_arena = { path = "../rustc_arena" }
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
|
|
|
@ -377,6 +377,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||||
ignore_binding: Option<NameBinding<'a>>,
|
ignore_binding: Option<NameBinding<'a>>,
|
||||||
) -> Result<NameBinding<'a>, Determinacy> {
|
) -> Result<NameBinding<'a>, Determinacy> {
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
struct Flags: u8 {
|
struct Flags: u8 {
|
||||||
const MACRO_RULES = 1 << 0;
|
const MACRO_RULES = 1 << 0;
|
||||||
const MODULE = 1 << 1;
|
const MODULE = 1 << 1;
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
getopts = "0.2"
|
getopts = "0.2"
|
||||||
rustc_ast = { path = "../rustc_ast" }
|
rustc_ast = { path = "../rustc_ast" }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
|
|
|
@ -1021,6 +1021,7 @@ impl OutputFilenames {
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
/// Scopes used to determined if it need to apply to --remap-path-prefix
|
/// Scopes used to determined if it need to apply to --remap-path-prefix
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub struct RemapPathScopeComponents: u8 {
|
pub struct RemapPathScopeComponents: u8 {
|
||||||
/// Apply remappings to the expansion of std::file!() macro
|
/// Apply remappings to the expansion of std::file!() macro
|
||||||
const MACRO = 1 << 0;
|
const MACRO = 1 << 0;
|
||||||
|
@ -1041,7 +1042,7 @@ bitflags::bitflags! {
|
||||||
/// An alias for macro,unsplit-debuginfo,split-debuginfo-path. This
|
/// An alias for macro,unsplit-debuginfo,split-debuginfo-path. This
|
||||||
/// ensures all paths in compiled executables or libraries are remapped
|
/// ensures all paths in compiled executables or libraries are remapped
|
||||||
/// but not elsewhere.
|
/// but not elsewhere.
|
||||||
const OBJECT = Self::MACRO.bits | Self::UNSPLIT_DEBUGINFO.bits | Self::SPLIT_DEBUGINFO_PATH.bits;
|
const OBJECT = Self::MACRO.bits() | Self::UNSPLIT_DEBUGINFO.bits() | Self::SPLIT_DEBUGINFO_PATH.bits();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
punycode = "0.4.0"
|
punycode = "0.4.0"
|
||||||
rustc-demangle = "0.1.21"
|
rustc-demangle = "0.1.21"
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
|
|
|
@ -11,6 +11,7 @@ use twox_hash::XxHash64;
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
/// Options for typeid_for_fnabi and typeid_for_fnsig.
|
/// Options for typeid_for_fnabi and typeid_for_fnsig.
|
||||||
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub struct TypeIdOptions: u32 {
|
pub struct TypeIdOptions: u32 {
|
||||||
const GENERALIZE_POINTERS = 1;
|
const GENERALIZE_POINTERS = 1;
|
||||||
const GENERALIZE_REPR_C = 2;
|
const GENERALIZE_REPR_C = 2;
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
rustc_abi = { path = "../rustc_abi" }
|
rustc_abi = { path = "../rustc_abi" }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||||
rustc_feature = { path = "../rustc_feature" }
|
rustc_feature = { path = "../rustc_feature" }
|
||||||
|
|
|
@ -93,9 +93,10 @@ pub use attr_impl::ArgAttribute;
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
mod attr_impl {
|
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.
|
||||||
|
#[derive(Clone, Copy, Default, Hash, PartialEq, Eq, HashStable_Generic)]
|
||||||
|
pub struct ArgAttribute(u8);
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[derive(Default, HashStable_Generic)]
|
impl ArgAttribute: u8 {
|
||||||
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;
|
||||||
|
@ -104,6 +105,7 @@ mod attr_impl {
|
||||||
const NoUndef = 1 << 6;
|
const NoUndef = 1 << 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { ArgAttribute }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sometimes an ABI requires small integers to be extended to a full or partial register. This enum
|
/// Sometimes an ABI requires small integers to be extended to a full or partial register. This enum
|
||||||
|
|
|
@ -39,7 +39,6 @@ use crate::abi::{Endian, Integer, Size, TargetDataLayout, TargetDataLayoutErrors
|
||||||
use crate::json::{Json, ToJson};
|
use crate::json::{Json, ToJson};
|
||||||
use crate::spec::abi::{lookup as lookup_abi, Abi};
|
use crate::spec::abi::{lookup as lookup_abi, Abi};
|
||||||
use crate::spec::crt_objects::CrtObjects;
|
use crate::spec::crt_objects::CrtObjects;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
|
||||||
use rustc_fs_util::try_canonicalize;
|
use rustc_fs_util::try_canonicalize;
|
||||||
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||||
use rustc_span::symbol::{kw, sym, Symbol};
|
use rustc_span::symbol::{kw, sym, Symbol};
|
||||||
|
@ -592,7 +591,7 @@ impl LinkSelfContainedDefault {
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[derive(Default)]
|
#[derive(Clone, Copy, PartialEq, Eq, Default)]
|
||||||
/// The `-C link-self-contained` components that can individually be enabled or disabled.
|
/// The `-C link-self-contained` components that can individually be enabled or disabled.
|
||||||
pub struct LinkSelfContainedComponents: u8 {
|
pub struct LinkSelfContainedComponents: u8 {
|
||||||
/// CRT objects (e.g. on `windows-gnu`, `musl`, `wasi` targets)
|
/// CRT objects (e.g. on `windows-gnu`, `musl`, `wasi` targets)
|
||||||
|
@ -609,6 +608,7 @@ bitflags::bitflags! {
|
||||||
const MINGW = 1 << 5;
|
const MINGW = 1 << 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { LinkSelfContainedComponents }
|
||||||
|
|
||||||
impl LinkSelfContainedComponents {
|
impl LinkSelfContainedComponents {
|
||||||
/// Parses a single `-Clink-self-contained` well-known component, not a set of flags.
|
/// Parses a single `-Clink-self-contained` well-known component, not a set of flags.
|
||||||
|
@ -667,19 +667,6 @@ impl LinkSelfContainedComponents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IntoIterator for LinkSelfContainedComponents {
|
|
||||||
type Item = LinkSelfContainedComponents;
|
|
||||||
type IntoIter = std::vec::IntoIter<LinkSelfContainedComponents>;
|
|
||||||
|
|
||||||
fn into_iter(self) -> Self::IntoIter {
|
|
||||||
LinkSelfContainedComponents::all_components()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|&s| self.contains(s))
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
.into_iter()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ToJson for LinkSelfContainedComponents {
|
impl ToJson for LinkSelfContainedComponents {
|
||||||
fn to_json(&self) -> Json {
|
fn to_json(&self) -> Json {
|
||||||
let components: Vec<_> = Self::all_components()
|
let components: Vec<_> = Self::all_components()
|
||||||
|
@ -1219,9 +1206,10 @@ impl ToJson for StackProbeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default, Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)]
|
||||||
|
pub struct SanitizerSet(u16);
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[derive(Default, Encodable, Decodable)]
|
impl SanitizerSet: u16 {
|
||||||
pub struct SanitizerSet: u16 {
|
|
||||||
const ADDRESS = 1 << 0;
|
const ADDRESS = 1 << 0;
|
||||||
const LEAK = 1 << 1;
|
const LEAK = 1 << 1;
|
||||||
const MEMORY = 1 << 2;
|
const MEMORY = 1 << 2;
|
||||||
|
@ -1235,6 +1223,7 @@ bitflags::bitflags! {
|
||||||
const SAFESTACK = 1 << 10;
|
const SAFESTACK = 1 << 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rustc_data_structures::external_bitflags_debug! { SanitizerSet }
|
||||||
|
|
||||||
impl SanitizerSet {
|
impl SanitizerSet {
|
||||||
/// Return sanitizer's name
|
/// Return sanitizer's name
|
||||||
|
@ -1274,38 +1263,6 @@ impl fmt::Display for SanitizerSet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IntoIterator for SanitizerSet {
|
|
||||||
type Item = SanitizerSet;
|
|
||||||
type IntoIter = std::vec::IntoIter<SanitizerSet>;
|
|
||||||
|
|
||||||
fn into_iter(self) -> Self::IntoIter {
|
|
||||||
[
|
|
||||||
SanitizerSet::ADDRESS,
|
|
||||||
SanitizerSet::CFI,
|
|
||||||
SanitizerSet::KCFI,
|
|
||||||
SanitizerSet::LEAK,
|
|
||||||
SanitizerSet::MEMORY,
|
|
||||||
SanitizerSet::MEMTAG,
|
|
||||||
SanitizerSet::SHADOWCALLSTACK,
|
|
||||||
SanitizerSet::THREAD,
|
|
||||||
SanitizerSet::HWADDRESS,
|
|
||||||
SanitizerSet::KERNELADDRESS,
|
|
||||||
SanitizerSet::SAFESTACK,
|
|
||||||
]
|
|
||||||
.iter()
|
|
||||||
.copied()
|
|
||||||
.filter(|&s| self.contains(s))
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
.into_iter()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<CTX> HashStable<CTX> for SanitizerSet {
|
|
||||||
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
|
|
||||||
self.bits().hash_stable(ctx, hasher);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ToJson for SanitizerSet {
|
impl ToJson for SanitizerSet {
|
||||||
fn to_json(&self) -> Json {
|
fn to_json(&self) -> Json {
|
||||||
self.into_iter()
|
self.into_iter()
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
bitflags = "1.2.1"
|
bitflags = "2.4.1"
|
||||||
derivative = "2.2.0"
|
derivative = "2.2.0"
|
||||||
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
|
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
|
||||||
rustc_index = { path = "../rustc_index", default-features = false }
|
rustc_index = { path = "../rustc_index", default-features = false }
|
||||||
|
|
|
@ -3,6 +3,7 @@ bitflags! {
|
||||||
/// through the type during type construction, so that we can quickly check
|
/// through the type during type construction, so that we can quickly check
|
||||||
/// whether the type has various kinds of types in it without recursing
|
/// whether the type has various kinds of types in it without recursing
|
||||||
/// over the type itself.
|
/// over the type itself.
|
||||||
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
pub struct TypeFlags: u32 {
|
pub struct TypeFlags: u32 {
|
||||||
// Does this have parameters? Used to determine whether substitution is
|
// Does this have parameters? Used to determine whether substitution is
|
||||||
// required.
|
// required.
|
||||||
|
@ -13,9 +14,9 @@ bitflags! {
|
||||||
/// Does this have `ConstKind::Param`?
|
/// Does this have `ConstKind::Param`?
|
||||||
const HAS_CT_PARAM = 1 << 2;
|
const HAS_CT_PARAM = 1 << 2;
|
||||||
|
|
||||||
const HAS_PARAM = TypeFlags::HAS_TY_PARAM.bits
|
const HAS_PARAM = TypeFlags::HAS_TY_PARAM.bits()
|
||||||
| TypeFlags::HAS_RE_PARAM.bits
|
| TypeFlags::HAS_RE_PARAM.bits()
|
||||||
| TypeFlags::HAS_CT_PARAM.bits;
|
| TypeFlags::HAS_CT_PARAM.bits();
|
||||||
|
|
||||||
/// Does this have `Infer`?
|
/// Does this have `Infer`?
|
||||||
const HAS_TY_INFER = 1 << 3;
|
const HAS_TY_INFER = 1 << 3;
|
||||||
|
@ -26,9 +27,9 @@ bitflags! {
|
||||||
|
|
||||||
/// Does this have inference variables? Used to determine whether
|
/// Does this have inference variables? Used to determine whether
|
||||||
/// inference is required.
|
/// inference is required.
|
||||||
const HAS_INFER = TypeFlags::HAS_TY_INFER.bits
|
const HAS_INFER = TypeFlags::HAS_TY_INFER.bits()
|
||||||
| TypeFlags::HAS_RE_INFER.bits
|
| TypeFlags::HAS_RE_INFER.bits()
|
||||||
| TypeFlags::HAS_CT_INFER.bits;
|
| TypeFlags::HAS_CT_INFER.bits();
|
||||||
|
|
||||||
/// Does this have `Placeholder`?
|
/// Does this have `Placeholder`?
|
||||||
const HAS_TY_PLACEHOLDER = 1 << 6;
|
const HAS_TY_PLACEHOLDER = 1 << 6;
|
||||||
|
@ -38,9 +39,9 @@ bitflags! {
|
||||||
const HAS_CT_PLACEHOLDER = 1 << 8;
|
const HAS_CT_PLACEHOLDER = 1 << 8;
|
||||||
|
|
||||||
/// Does this have placeholders?
|
/// Does this have placeholders?
|
||||||
const HAS_PLACEHOLDER = TypeFlags::HAS_TY_PLACEHOLDER.bits
|
const HAS_PLACEHOLDER = TypeFlags::HAS_TY_PLACEHOLDER.bits()
|
||||||
| TypeFlags::HAS_RE_PLACEHOLDER.bits
|
| TypeFlags::HAS_RE_PLACEHOLDER.bits()
|
||||||
| TypeFlags::HAS_CT_PLACEHOLDER.bits;
|
| TypeFlags::HAS_CT_PLACEHOLDER.bits();
|
||||||
|
|
||||||
/// `true` if there are "names" of regions and so forth
|
/// `true` if there are "names" of regions and so forth
|
||||||
/// that are local to a particular fn/inferctxt
|
/// that are local to a particular fn/inferctxt
|
||||||
|
@ -48,12 +49,12 @@ bitflags! {
|
||||||
|
|
||||||
/// `true` if there are "names" of types and regions and so forth
|
/// `true` if there are "names" of types and regions and so forth
|
||||||
/// that are local to a particular fn
|
/// that are local to a particular fn
|
||||||
const HAS_FREE_LOCAL_NAMES = TypeFlags::HAS_TY_PARAM.bits
|
const HAS_FREE_LOCAL_NAMES = TypeFlags::HAS_TY_PARAM.bits()
|
||||||
| TypeFlags::HAS_CT_PARAM.bits
|
| TypeFlags::HAS_CT_PARAM.bits()
|
||||||
| TypeFlags::HAS_TY_INFER.bits
|
| TypeFlags::HAS_TY_INFER.bits()
|
||||||
| TypeFlags::HAS_CT_INFER.bits
|
| TypeFlags::HAS_CT_INFER.bits()
|
||||||
| TypeFlags::HAS_TY_PLACEHOLDER.bits
|
| TypeFlags::HAS_TY_PLACEHOLDER.bits()
|
||||||
| TypeFlags::HAS_CT_PLACEHOLDER.bits
|
| TypeFlags::HAS_CT_PLACEHOLDER.bits()
|
||||||
// We consider 'freshened' types and constants
|
// We consider 'freshened' types and constants
|
||||||
// to depend on a particular fn.
|
// to depend on a particular fn.
|
||||||
// The freshening process throws away information,
|
// The freshening process throws away information,
|
||||||
|
@ -61,10 +62,10 @@ bitflags! {
|
||||||
// cache. Note that there is no 'fresh lifetime' flag -
|
// cache. Note that there is no 'fresh lifetime' flag -
|
||||||
// freshening replaces all lifetimes with `ReErased`,
|
// freshening replaces all lifetimes with `ReErased`,
|
||||||
// which is different from how types/const are freshened.
|
// which is different from how types/const are freshened.
|
||||||
| TypeFlags::HAS_TY_FRESH.bits
|
| TypeFlags::HAS_TY_FRESH.bits()
|
||||||
| TypeFlags::HAS_CT_FRESH.bits
|
| TypeFlags::HAS_CT_FRESH.bits()
|
||||||
| TypeFlags::HAS_FREE_LOCAL_REGIONS.bits
|
| TypeFlags::HAS_FREE_LOCAL_REGIONS.bits()
|
||||||
| TypeFlags::HAS_RE_ERASED.bits;
|
| TypeFlags::HAS_RE_ERASED.bits();
|
||||||
|
|
||||||
/// Does this have `Projection`?
|
/// Does this have `Projection`?
|
||||||
const HAS_TY_PROJECTION = 1 << 10;
|
const HAS_TY_PROJECTION = 1 << 10;
|
||||||
|
@ -76,10 +77,10 @@ bitflags! {
|
||||||
const HAS_CT_PROJECTION = 1 << 13;
|
const HAS_CT_PROJECTION = 1 << 13;
|
||||||
|
|
||||||
/// Could this type be normalized further?
|
/// Could this type be normalized further?
|
||||||
const HAS_PROJECTION = TypeFlags::HAS_TY_PROJECTION.bits
|
const HAS_PROJECTION = TypeFlags::HAS_TY_PROJECTION.bits()
|
||||||
| TypeFlags::HAS_TY_OPAQUE.bits
|
| TypeFlags::HAS_TY_OPAQUE.bits()
|
||||||
| TypeFlags::HAS_TY_INHERENT.bits
|
| TypeFlags::HAS_TY_INHERENT.bits()
|
||||||
| TypeFlags::HAS_CT_PROJECTION.bits;
|
| TypeFlags::HAS_CT_PROJECTION.bits();
|
||||||
|
|
||||||
/// Is an error type/const reachable?
|
/// Is an error type/const reachable?
|
||||||
const HAS_ERROR = 1 << 14;
|
const HAS_ERROR = 1 << 14;
|
||||||
|
@ -96,9 +97,9 @@ bitflags! {
|
||||||
const HAS_CT_BOUND = 1 << 18;
|
const HAS_CT_BOUND = 1 << 18;
|
||||||
/// Does this have any bound variables?
|
/// Does this have any bound variables?
|
||||||
/// Used to check if a global bound is safe to evaluate.
|
/// Used to check if a global bound is safe to evaluate.
|
||||||
const HAS_BOUND_VARS = TypeFlags::HAS_RE_BOUND.bits
|
const HAS_BOUND_VARS = TypeFlags::HAS_RE_BOUND.bits()
|
||||||
| TypeFlags::HAS_TY_BOUND.bits
|
| TypeFlags::HAS_TY_BOUND.bits()
|
||||||
| TypeFlags::HAS_CT_BOUND.bits;
|
| TypeFlags::HAS_CT_BOUND.bits();
|
||||||
|
|
||||||
/// Does this have any `ReErased` regions?
|
/// Does this have any `ReErased` regions?
|
||||||
const HAS_RE_ERASED = 1 << 19;
|
const HAS_RE_ERASED = 1 << 19;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
StorageDead(_3);
|
StorageDead(_3);
|
||||||
StorageLive(_4);
|
StorageLive(_4);
|
||||||
- _4 = inline_always_and_using_inline_asm() -> [return: bb4, unwind unreachable];
|
- _4 = inline_always_and_using_inline_asm() -> [return: bb4, unwind unreachable];
|
||||||
+ asm!("/* do nothing */", options((empty))) -> [return: bb3, unwind unreachable];
|
+ asm!("/* do nothing */", options()) -> [return: bb3, unwind unreachable];
|
||||||
}
|
}
|
||||||
|
|
||||||
- bb4: {
|
- bb4: {
|
||||||
|
|
|
@ -93,9 +93,9 @@ body:
|
||||||
adt_def:
|
adt_def:
|
||||||
AdtDef {
|
AdtDef {
|
||||||
did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
|
did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
|
||||||
variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
|
variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: }]
|
||||||
flags: IS_ENUM
|
flags: IS_ENUM
|
||||||
repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 }
|
repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 }
|
||||||
args: []
|
args: []
|
||||||
variant_index: 0
|
variant_index: 0
|
||||||
subpatterns: [
|
subpatterns: [
|
||||||
|
@ -107,9 +107,9 @@ body:
|
||||||
adt_def:
|
adt_def:
|
||||||
AdtDef {
|
AdtDef {
|
||||||
did: DefId(0:3 ~ thir_tree_match[fcf8]::Bar)
|
did: DefId(0:3 ~ thir_tree_match[fcf8]::Bar)
|
||||||
variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[fcf8]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[fcf8]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[fcf8]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[fcf8]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[fcf8]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[fcf8]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags: NO_VARIANT_FLAGS }]
|
variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[fcf8]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[fcf8]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags: }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[fcf8]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[fcf8]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags: }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[fcf8]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[fcf8]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags: }]
|
||||||
flags: IS_ENUM
|
flags: IS_ENUM
|
||||||
repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 10333377570083945360 }
|
repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 10333377570083945360 }
|
||||||
args: []
|
args: []
|
||||||
variant_index: 0
|
variant_index: 0
|
||||||
subpatterns: []
|
subpatterns: []
|
||||||
|
@ -155,9 +155,9 @@ body:
|
||||||
adt_def:
|
adt_def:
|
||||||
AdtDef {
|
AdtDef {
|
||||||
did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
|
did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
|
||||||
variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
|
variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: }]
|
||||||
flags: IS_ENUM
|
flags: IS_ENUM
|
||||||
repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 }
|
repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 }
|
||||||
args: []
|
args: []
|
||||||
variant_index: 0
|
variant_index: 0
|
||||||
subpatterns: [
|
subpatterns: [
|
||||||
|
@ -207,9 +207,9 @@ body:
|
||||||
adt_def:
|
adt_def:
|
||||||
AdtDef {
|
AdtDef {
|
||||||
did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
|
did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
|
||||||
variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
|
variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: }]
|
||||||
flags: IS_ENUM
|
flags: IS_ENUM
|
||||||
repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 }
|
repr: ReprOptions { int: None, align: None, pack: None, flags: , field_shuffle_seed: 3477539199540094892 }
|
||||||
args: []
|
args: []
|
||||||
variant_index: 1
|
variant_index: 1
|
||||||
subpatterns: []
|
subpatterns: []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue