11use std:: cell:: RefCell ;
22use std:: fmt;
3- use std:: num:: NonZeroU64 ;
3+ use std:: num:: NonZero ;
44
55use log:: trace;
66use smallvec:: SmallVec ;
@@ -13,22 +13,22 @@ use crate::*;
1313pub mod stacked_borrows;
1414pub mod tree_borrows;
1515
16- pub type CallId = NonZeroU64 ;
16+ pub type CallId = NonZero < u64 > ;
1717
1818/// Tracking pointer provenance
1919#[ derive( Copy , Clone , Hash , PartialEq , Eq , PartialOrd , Ord ) ]
20- pub struct BorTag ( NonZeroU64 ) ;
20+ pub struct BorTag ( NonZero < u64 > ) ;
2121
2222impl BorTag {
2323 pub fn new ( i : u64 ) -> Option < Self > {
24- NonZeroU64 :: new ( i) . map ( BorTag )
24+ NonZero :: new ( i) . map ( BorTag )
2525 }
2626
2727 pub fn get ( & self ) -> u64 {
2828 self . 0 . get ( )
2929 }
3030
31- pub fn inner ( & self ) -> NonZeroU64 {
31+ pub fn inner ( & self ) -> NonZero < u64 > {
3232 self . 0
3333 }
3434
@@ -184,7 +184,7 @@ impl GlobalStateInner {
184184 borrow_tracker_method,
185185 next_ptr_tag : BorTag :: one ( ) ,
186186 base_ptr_tags : FxHashMap :: default ( ) ,
187- next_call_id : NonZeroU64 :: new ( 1 ) . unwrap ( ) ,
187+ next_call_id : NonZero :: new ( 1 ) . unwrap ( ) ,
188188 protected_tags : FxHashMap :: default ( ) ,
189189 tracked_pointer_tags,
190190 tracked_call_ids,
@@ -206,7 +206,7 @@ impl GlobalStateInner {
206206 if self . tracked_call_ids . contains ( & call_id) {
207207 machine. emit_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( call_id) ) ;
208208 }
209- self . next_call_id = NonZeroU64 :: new ( call_id. get ( ) + 1 ) . unwrap ( ) ;
209+ self . next_call_id = NonZero :: new ( call_id. get ( ) + 1 ) . unwrap ( ) ;
210210 FrameState { call_id, protected_tags : SmallVec :: new ( ) }
211211 }
212212
0 commit comments