@@ -118,7 +118,8 @@ impl ExpnId {
118118 HygieneData :: with ( |data| {
119119 let old_expn_data = & mut data. expn_data [ self . 0 as usize ] ;
120120 assert ! ( old_expn_data. is_none( ) , "expansion data is reset for an expansion ID" ) ;
121- expn_data. orig_id . replace ( self . as_u32 ( ) ) . expect_none ( "orig_id should be None" ) ;
121+ assert_eq ! ( expn_data. orig_id, None ) ;
122+ expn_data. orig_id = Some ( self . as_u32 ( ) ) ;
122123 * old_expn_data = Some ( expn_data) ;
123124 } ) ;
124125 update_disambiguator ( self )
@@ -202,7 +203,8 @@ impl HygieneData {
202203 fn fresh_expn ( & mut self , mut expn_data : Option < ExpnData > ) -> ExpnId {
203204 let raw_id = self . expn_data . len ( ) as u32 ;
204205 if let Some ( data) = expn_data. as_mut ( ) {
205- data. orig_id . replace ( raw_id) . expect_none ( "orig_id should be None" ) ;
206+ assert_eq ! ( data. orig_id, None ) ;
207+ data. orig_id = Some ( raw_id) ;
206208 }
207209 self . expn_data . push ( expn_data) ;
208210 ExpnId ( raw_id)
@@ -1410,9 +1412,11 @@ fn update_disambiguator(expn_id: ExpnId) {
14101412 let new_hash: Fingerprint = hasher. finish ( ) ;
14111413
14121414 HygieneData :: with ( |data| {
1413- data. expn_data_disambiguators
1414- . get ( & new_hash)
1415- . expect_none ( "Hash collision after disambiguator update!" ) ;
1415+ assert_eq ! (
1416+ data. expn_data_disambiguators. get( & new_hash) ,
1417+ None ,
1418+ "Hash collision after disambiguator update!" ,
1419+ ) ;
14161420 } ) ;
14171421 } ;
14181422 }
0 commit comments