11use std:: cell:: RefCell ;
22use std:: fmt;
3- use std:: num:: NonZeroU64 ;
3+ use std:: num:: NonZero ;
44
55use smallvec:: SmallVec ;
66
@@ -12,22 +12,22 @@ use crate::*;
1212pub mod stacked_borrows;
1313pub mod tree_borrows;
1414
15- pub type CallId = NonZeroU64 ;
15+ pub type CallId = NonZero < u64 > ;
1616
1717/// Tracking pointer provenance
1818#[ derive( Copy , Clone , Hash , PartialEq , Eq , PartialOrd , Ord ) ]
19- pub struct BorTag ( NonZeroU64 ) ;
19+ pub struct BorTag ( NonZero < u64 > ) ;
2020
2121impl BorTag {
2222 pub fn new ( i : u64 ) -> Option < Self > {
23- NonZeroU64 :: new ( i) . map ( BorTag )
23+ NonZero :: new ( i) . map ( BorTag )
2424 }
2525
2626 pub fn get ( & self ) -> u64 {
2727 self . 0 . get ( )
2828 }
2929
30- pub fn inner ( & self ) -> NonZeroU64 {
30+ pub fn inner ( & self ) -> NonZero < u64 > {
3131 self . 0
3232 }
3333
@@ -183,7 +183,7 @@ impl GlobalStateInner {
183183 borrow_tracker_method,
184184 next_ptr_tag : BorTag :: one ( ) ,
185185 base_ptr_tags : FxHashMap :: default ( ) ,
186- next_call_id : NonZeroU64 :: new ( 1 ) . unwrap ( ) ,
186+ next_call_id : NonZero :: new ( 1 ) . unwrap ( ) ,
187187 protected_tags : FxHashMap :: default ( ) ,
188188 tracked_pointer_tags,
189189 tracked_call_ids,
@@ -205,7 +205,7 @@ impl GlobalStateInner {
205205 if self . tracked_call_ids . contains ( & call_id) {
206206 machine. emit_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( call_id) ) ;
207207 }
208- self . next_call_id = NonZeroU64 :: new ( call_id. get ( ) + 1 ) . unwrap ( ) ;
208+ self . next_call_id = NonZero :: new ( call_id. get ( ) + 1 ) . unwrap ( ) ;
209209 FrameState { call_id, protected_tags : SmallVec :: new ( ) }
210210 }
211211
0 commit comments