@@ -118,7 +118,8 @@ impl ExpnId {
118
118
HygieneData :: with ( |data| {
119
119
let old_expn_data = & mut data. expn_data [ self . 0 as usize ] ;
120
120
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 ( ) ) ;
122
123
* old_expn_data = Some ( expn_data) ;
123
124
} ) ;
124
125
update_disambiguator ( self )
@@ -202,7 +203,8 @@ impl HygieneData {
202
203
fn fresh_expn ( & mut self , mut expn_data : Option < ExpnData > ) -> ExpnId {
203
204
let raw_id = self . expn_data . len ( ) as u32 ;
204
205
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) ;
206
208
}
207
209
self . expn_data . push ( expn_data) ;
208
210
ExpnId ( raw_id)
@@ -1410,9 +1412,11 @@ fn update_disambiguator(expn_id: ExpnId) {
1410
1412
let new_hash: Fingerprint = hasher. finish ( ) ;
1411
1413
1412
1414
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
+ ) ;
1416
1420
} ) ;
1417
1421
} ;
1418
1422
}
0 commit comments