1
Fork 0

Use generic NonZero internally.

This commit is contained in:
Markus Reiter 2024-01-29 23:59:09 +01:00
parent ee9c7c940c
commit 746a58d435
No known key found for this signature in database
GPG key ID: 245293B51702655B
144 changed files with 653 additions and 604 deletions

View file

@ -20,7 +20,7 @@ use rustc_target::spec::{abi::Abi as SpecAbi, HasTargetSpec, PanicStrategy, Targ
use std::cmp;
use std::fmt;
use std::num::NonZeroUsize;
use std::num::NonZero;
use std::ops::Bound;
pub trait IntegerExt {
@ -761,7 +761,7 @@ where
};
tcx.mk_layout(LayoutS {
variants: Variants::Single { index: variant_index },
fields: match NonZeroUsize::new(fields) {
fields: match NonZero::<usize>::new(fields) {
Some(fields) => FieldsShape::Union(fields),
None => FieldsShape::Arbitrary { offsets: IndexVec::new(), memory_index: IndexVec::new() },
},