Add c_enum_min_bits to target spec
This commit is contained in:
parent
ae90dcf020
commit
fd116c806a
6 changed files with 515 additions and 16 deletions
|
@ -112,9 +112,6 @@ impl IntegerExt for Integer {
|
||||||
let unsigned_fit = Integer::fit_unsigned(cmp::max(min as u128, max as u128));
|
let unsigned_fit = Integer::fit_unsigned(cmp::max(min as u128, max as u128));
|
||||||
let signed_fit = cmp::max(Integer::fit_signed(min), Integer::fit_signed(max));
|
let signed_fit = cmp::max(Integer::fit_signed(min), Integer::fit_signed(max));
|
||||||
|
|
||||||
let mut min_from_extern = None;
|
|
||||||
let min_default = I8;
|
|
||||||
|
|
||||||
if let Some(ity) = repr.int {
|
if let Some(ity) = repr.int {
|
||||||
let discr = Integer::from_attr(&tcx, ity);
|
let discr = Integer::from_attr(&tcx, ity);
|
||||||
let fit = if ity.is_signed() { signed_fit } else { unsigned_fit };
|
let fit = if ity.is_signed() { signed_fit } else { unsigned_fit };
|
||||||
|
@ -128,19 +125,14 @@ impl IntegerExt for Integer {
|
||||||
return (discr, ity.is_signed());
|
return (discr, ity.is_signed());
|
||||||
}
|
}
|
||||||
|
|
||||||
if repr.c() {
|
let at_least = if repr.c() {
|
||||||
match &tcx.sess.target.arch[..] {
|
// This is usually I32, however it can be different on some platforms,
|
||||||
"hexagon" => min_from_extern = Some(I8),
|
// notably hexagon and arm-none/thumb-none
|
||||||
// WARNING: the ARM EABI has two variants; the one corresponding
|
tcx.data_layout().c_enum_min_size
|
||||||
// to `at_least == I32` appears to be used on Linux and NetBSD,
|
} else {
|
||||||
// but some systems may use the variant corresponding to no
|
// repr(Rust) enums try to be as small as possible
|
||||||
// lower bound. However, we don't run on those yet...?
|
I8
|
||||||
"arm" => min_from_extern = Some(I32),
|
};
|
||||||
_ => min_from_extern = Some(I32),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let at_least = min_from_extern.unwrap_or(min_default);
|
|
||||||
|
|
||||||
// If there are no negative values, we can use the unsigned fit.
|
// If there are no negative values, we can use the unsigned fit.
|
||||||
if min >= 0 {
|
if min >= 0 {
|
||||||
|
|
|
@ -36,6 +36,9 @@ pub struct TargetDataLayout {
|
||||||
pub vector_align: Vec<(Size, AbiAndPrefAlign)>,
|
pub vector_align: Vec<(Size, AbiAndPrefAlign)>,
|
||||||
|
|
||||||
pub instruction_address_space: AddressSpace,
|
pub instruction_address_space: AddressSpace,
|
||||||
|
|
||||||
|
/// Minimum size of #[repr(C)] enums (default I32 bits)
|
||||||
|
pub c_enum_min_size: Integer,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TargetDataLayout {
|
impl Default for TargetDataLayout {
|
||||||
|
@ -60,6 +63,7 @@ impl Default for TargetDataLayout {
|
||||||
(Size::from_bits(128), AbiAndPrefAlign::new(align(128))),
|
(Size::from_bits(128), AbiAndPrefAlign::new(align(128))),
|
||||||
],
|
],
|
||||||
instruction_address_space: AddressSpace::DATA,
|
instruction_address_space: AddressSpace::DATA,
|
||||||
|
c_enum_min_size: Integer::I32,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,6 +177,8 @@ impl TargetDataLayout {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dl.c_enum_min_size = Integer::from_size(Size::from_bits(target.c_enum_min_bits))?;
|
||||||
|
|
||||||
Ok(dl)
|
Ok(dl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,6 +616,17 @@ impl Integer {
|
||||||
}
|
}
|
||||||
I8
|
I8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn from_size(size: Size) -> Result<Self, String> {
|
||||||
|
match size.bits() {
|
||||||
|
8 => Ok(Integer::I8),
|
||||||
|
16 => Ok(Integer::I16),
|
||||||
|
32 => Ok(Integer::I32),
|
||||||
|
64 => Ok(Integer::I64),
|
||||||
|
128 => Ok(Integer::I128),
|
||||||
|
_ => Err(format!("rust does not support integers with {} bits", size.bits())),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fundamental unit of memory access and layout.
|
/// Fundamental unit of memory access and layout.
|
||||||
|
|
|
@ -13,6 +13,8 @@ pub fn target() -> Target {
|
||||||
base.dynamic_linking = true;
|
base.dynamic_linking = true;
|
||||||
base.executables = true;
|
base.executables = true;
|
||||||
|
|
||||||
|
base.c_enum_min_bits = 8;
|
||||||
|
|
||||||
Target {
|
Target {
|
||||||
llvm_target: "hexagon-unknown-linux-musl".to_string(),
|
llvm_target: "hexagon-unknown-linux-musl".to_string(),
|
||||||
pointer_width: 32,
|
pointer_width: 32,
|
||||||
|
|
|
@ -1335,6 +1335,9 @@ pub struct TargetOptions {
|
||||||
|
|
||||||
/// If present it's a default value to use for adjusting the C ABI.
|
/// If present it's a default value to use for adjusting the C ABI.
|
||||||
pub default_adjusted_cabi: Option<Abi>,
|
pub default_adjusted_cabi: Option<Abi>,
|
||||||
|
|
||||||
|
/// Minimum number of bits in #[repr(C)] enum. Defaults to 32.
|
||||||
|
pub c_enum_min_bits: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TargetOptions {
|
impl Default for TargetOptions {
|
||||||
|
@ -1439,6 +1442,7 @@ impl Default for TargetOptions {
|
||||||
split_debuginfo: SplitDebuginfo::Off,
|
split_debuginfo: SplitDebuginfo::Off,
|
||||||
supported_sanitizers: SanitizerSet::empty(),
|
supported_sanitizers: SanitizerSet::empty(),
|
||||||
default_adjusted_cabi: None,
|
default_adjusted_cabi: None,
|
||||||
|
c_enum_min_bits: 32,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1603,6 +1607,12 @@ impl Target {
|
||||||
base.$key_name = s;
|
base.$key_name = s;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
($key_name:ident, u64) => ( {
|
||||||
|
let name = (stringify!($key_name)).replace("_", "-");
|
||||||
|
if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_u64(&j)) {
|
||||||
|
base.$key_name = s;
|
||||||
|
}
|
||||||
|
} );
|
||||||
($key_name:ident, Option<u32>) => ( {
|
($key_name:ident, Option<u32>) => ( {
|
||||||
let name = (stringify!($key_name)).replace("_", "-");
|
let name = (stringify!($key_name)).replace("_", "-");
|
||||||
if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_u64(&j)) {
|
if let Some(s) = obj.remove_key(&name).and_then(|j| Json::as_u64(&j)) {
|
||||||
|
@ -2016,6 +2026,7 @@ impl Target {
|
||||||
key!(split_debuginfo, SplitDebuginfo)?;
|
key!(split_debuginfo, SplitDebuginfo)?;
|
||||||
key!(supported_sanitizers, SanitizerSet)?;
|
key!(supported_sanitizers, SanitizerSet)?;
|
||||||
key!(default_adjusted_cabi, Option<Abi>)?;
|
key!(default_adjusted_cabi, Option<Abi>)?;
|
||||||
|
key!(c_enum_min_bits, u64);
|
||||||
|
|
||||||
if base.is_builtin {
|
if base.is_builtin {
|
||||||
// This can cause unfortunate ICEs later down the line.
|
// This can cause unfortunate ICEs later down the line.
|
||||||
|
@ -2254,6 +2265,7 @@ impl ToJson for Target {
|
||||||
target_option_val!(has_thumb_interworking);
|
target_option_val!(has_thumb_interworking);
|
||||||
target_option_val!(split_debuginfo);
|
target_option_val!(split_debuginfo);
|
||||||
target_option_val!(supported_sanitizers);
|
target_option_val!(supported_sanitizers);
|
||||||
|
target_option_val!(c_enum_min_bits);
|
||||||
|
|
||||||
if let Some(abi) = self.default_adjusted_cabi {
|
if let Some(abi) = self.default_adjusted_cabi {
|
||||||
d.insert("default-adjusted-cabi".to_string(), Abi::name(abi).to_json());
|
d.insert("default-adjusted-cabi".to_string(), Abi::name(abi).to_json());
|
||||||
|
|
34
src/test/ui/layout/thumb-enum.rs
Normal file
34
src/test/ui/layout/thumb-enum.rs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// compile-flags: --target thumbv8m.main-none-eabihf
|
||||||
|
// needs-llvm-components: arm
|
||||||
|
//
|
||||||
|
// Verify that thumb targets implement the repr(C) for enums correctly.
|
||||||
|
//
|
||||||
|
// See #87917
|
||||||
|
#![feature(never_type, rustc_attrs, no_core, lang_items)]
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
#![no_core]
|
||||||
|
|
||||||
|
#[lang="sized"]
|
||||||
|
trait Sized {}
|
||||||
|
|
||||||
|
#[rustc_layout(debug)]
|
||||||
|
#[repr(C)]
|
||||||
|
enum A { Apple } //~ ERROR: layout_of
|
||||||
|
|
||||||
|
#[rustc_layout(debug)]
|
||||||
|
#[repr(C)]
|
||||||
|
enum B { Banana = 255, } //~ ERROR: layout_of
|
||||||
|
|
||||||
|
#[rustc_layout(debug)]
|
||||||
|
#[repr(C)]
|
||||||
|
enum C { Chaenomeles = 256, } //~ ERROR: layout_of
|
||||||
|
|
||||||
|
#[rustc_layout(debug)]
|
||||||
|
#[repr(C)]
|
||||||
|
enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of
|
||||||
|
|
||||||
|
const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator!
|
||||||
|
|
||||||
|
#[rustc_layout(debug)]
|
||||||
|
#[repr(C)]
|
||||||
|
enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of
|
442
src/test/ui/layout/thumb-enum.stderr
Normal file
442
src/test/ui/layout/thumb-enum.stderr
Normal file
|
@ -0,0 +1,442 @@
|
||||||
|
error: layout_of(A) = Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [
|
||||||
|
Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
memory_index: [
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
variants: Multiple {
|
||||||
|
tag: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I8,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 0..=0,
|
||||||
|
},
|
||||||
|
tag_encoding: Direct,
|
||||||
|
tag_field: 0,
|
||||||
|
variants: [
|
||||||
|
Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [],
|
||||||
|
memory_index: [],
|
||||||
|
},
|
||||||
|
variants: Single {
|
||||||
|
index: 0,
|
||||||
|
},
|
||||||
|
abi: Aggregate {
|
||||||
|
sized: true,
|
||||||
|
},
|
||||||
|
largest_niche: None,
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 0,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
abi: Scalar(
|
||||||
|
Scalar {
|
||||||
|
value: Int(
|
||||||
|
I8,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 0..=0,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
largest_niche: Some(
|
||||||
|
Niche {
|
||||||
|
offset: Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
scalar: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I8,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 0..=0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 0,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--> $DIR/thumb-enum.rs:16:1
|
||||||
|
|
|
||||||
|
LL | enum A { Apple }
|
||||||
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: layout_of(B) = Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [
|
||||||
|
Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
memory_index: [
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
variants: Multiple {
|
||||||
|
tag: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I8,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 255..=255,
|
||||||
|
},
|
||||||
|
tag_encoding: Direct,
|
||||||
|
tag_field: 0,
|
||||||
|
variants: [
|
||||||
|
Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [],
|
||||||
|
memory_index: [],
|
||||||
|
},
|
||||||
|
variants: Single {
|
||||||
|
index: 0,
|
||||||
|
},
|
||||||
|
abi: Aggregate {
|
||||||
|
sized: true,
|
||||||
|
},
|
||||||
|
largest_niche: None,
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 0,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
abi: Scalar(
|
||||||
|
Scalar {
|
||||||
|
value: Int(
|
||||||
|
I8,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 255..=255,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
largest_niche: Some(
|
||||||
|
Niche {
|
||||||
|
offset: Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
scalar: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I8,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 255..=255,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 0,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--> $DIR/thumb-enum.rs:20:1
|
||||||
|
|
|
||||||
|
LL | enum B { Banana = 255, }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: layout_of(C) = Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [
|
||||||
|
Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
memory_index: [
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
variants: Multiple {
|
||||||
|
tag: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I16,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 256..=256,
|
||||||
|
},
|
||||||
|
tag_encoding: Direct,
|
||||||
|
tag_field: 0,
|
||||||
|
variants: [
|
||||||
|
Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [],
|
||||||
|
memory_index: [],
|
||||||
|
},
|
||||||
|
variants: Single {
|
||||||
|
index: 0,
|
||||||
|
},
|
||||||
|
abi: Aggregate {
|
||||||
|
sized: true,
|
||||||
|
},
|
||||||
|
largest_niche: None,
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 1,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
abi: Scalar(
|
||||||
|
Scalar {
|
||||||
|
value: Int(
|
||||||
|
I16,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 256..=256,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
largest_niche: Some(
|
||||||
|
Niche {
|
||||||
|
offset: Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
scalar: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I16,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 256..=256,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 1,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 2,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--> $DIR/thumb-enum.rs:24:1
|
||||||
|
|
|
||||||
|
LL | enum C { Chaenomeles = 256, }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: layout_of(P) = Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [
|
||||||
|
Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
memory_index: [
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
variants: Multiple {
|
||||||
|
tag: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I32,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 268435456..=268435456,
|
||||||
|
},
|
||||||
|
tag_encoding: Direct,
|
||||||
|
tag_field: 0,
|
||||||
|
variants: [
|
||||||
|
Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [],
|
||||||
|
memory_index: [],
|
||||||
|
},
|
||||||
|
variants: Single {
|
||||||
|
index: 0,
|
||||||
|
},
|
||||||
|
abi: Aggregate {
|
||||||
|
sized: true,
|
||||||
|
},
|
||||||
|
largest_niche: None,
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
abi: Scalar(
|
||||||
|
Scalar {
|
||||||
|
value: Int(
|
||||||
|
I32,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 268435456..=268435456,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
largest_niche: Some(
|
||||||
|
Niche {
|
||||||
|
offset: Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
scalar: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I32,
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
valid_range: 268435456..=268435456,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 4,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--> $DIR/thumb-enum.rs:28:1
|
||||||
|
|
|
||||||
|
LL | enum P { Peach = 0x1000_0000isize, }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: layout_of(T) = Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [
|
||||||
|
Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
memory_index: [
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
variants: Multiple {
|
||||||
|
tag: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I32,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
valid_range: 2164260864..=2164260864,
|
||||||
|
},
|
||||||
|
tag_encoding: Direct,
|
||||||
|
tag_field: 0,
|
||||||
|
variants: [
|
||||||
|
Layout {
|
||||||
|
fields: Arbitrary {
|
||||||
|
offsets: [],
|
||||||
|
memory_index: [],
|
||||||
|
},
|
||||||
|
variants: Single {
|
||||||
|
index: 0,
|
||||||
|
},
|
||||||
|
abi: Aggregate {
|
||||||
|
sized: true,
|
||||||
|
},
|
||||||
|
largest_niche: None,
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
abi: Scalar(
|
||||||
|
Scalar {
|
||||||
|
value: Int(
|
||||||
|
I32,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
valid_range: 2164260864..=2164260864,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
largest_niche: Some(
|
||||||
|
Niche {
|
||||||
|
offset: Size {
|
||||||
|
raw: 0,
|
||||||
|
},
|
||||||
|
scalar: Scalar {
|
||||||
|
value: Int(
|
||||||
|
I32,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
valid_range: 2164260864..=2164260864,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
align: AbiAndPrefAlign {
|
||||||
|
abi: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
pref: Align {
|
||||||
|
pow2: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
size: Size {
|
||||||
|
raw: 4,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
--> $DIR/thumb-enum.rs:34:1
|
||||||
|
|
|
||||||
|
LL | enum T { Tangerine = TANGERINE as isize }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 5 previous errors
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue