mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
Temporarily revert to NonZeroUsize in rustc-abi to fix building on stable
This commit is contained in:
parent
97bf25c8cf
commit
8ec5a3d7b4
@ -2,7 +2,6 @@ use std::borrow::{Borrow, Cow};
|
||||
use std::cmp;
|
||||
use std::fmt::{self, Write};
|
||||
use std::iter;
|
||||
use std::num::NonZero;
|
||||
use std::ops::Bound;
|
||||
use std::ops::Deref;
|
||||
|
||||
@ -11,8 +10,8 @@ use tracing::debug;
|
||||
|
||||
use crate::{
|
||||
Abi, AbiAndPrefAlign, Align, FieldsShape, IndexSlice, IndexVec, Integer, LayoutS, Niche,
|
||||
Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding, TargetDataLayout, Variants,
|
||||
WrappingRange,
|
||||
NonZeroUsize, Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding, TargetDataLayout,
|
||||
Variants, WrappingRange,
|
||||
};
|
||||
|
||||
// A variant is absent if it's uninhabited and only has ZST fields.
|
||||
@ -328,7 +327,7 @@ pub trait LayoutCalculator {
|
||||
|
||||
Some(LayoutS {
|
||||
variants: Variants::Single { index: VariantIdx::new(0) },
|
||||
fields: FieldsShape::Union(NonZero::new(only_variant.len())?),
|
||||
fields: FieldsShape::Union(NonZeroUsize::new(only_variant.len())?),
|
||||
abi,
|
||||
largest_niche: None,
|
||||
align,
|
||||
|
@ -4,7 +4,7 @@
|
||||
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
|
||||
|
||||
use std::fmt;
|
||||
use std::num::{NonZero, ParseIntError};
|
||||
use std::num::{NonZeroUsize, ParseIntError};
|
||||
use std::ops::{Add, AddAssign, Mul, RangeInclusive, Sub};
|
||||
use std::str::FromStr;
|
||||
|
||||
@ -1175,7 +1175,7 @@ pub enum FieldsShape<FieldIdx: Idx> {
|
||||
Primitive,
|
||||
|
||||
/// All fields start at no offset. The `usize` is the field count.
|
||||
Union(NonZero<usize>),
|
||||
Union(NonZeroUsize),
|
||||
|
||||
/// Array/vector-like placement, with all fields of identical types.
|
||||
Array { stride: Size, count: u64 },
|
||||
|
Loading…
Reference in New Issue
Block a user