@@ -257,7 +257,7 @@ impl DefPath {
257257 debug ! ( "DefPath::make: key={:?}" , key) ;
258258 match key. disambiguated_data . data {
259259 DefPathData :: CrateRoot => {
260- assert ! ( key. parent. is_none( ) ) ;
260+ debug_assert ! ( key. parent. is_none( ) ) ;
261261 break ;
262262 }
263263 _ => {
@@ -500,7 +500,7 @@ impl Definitions {
500500 let address_space = super :: ITEM_LIKE_SPACE ;
501501 let root_index = self . table . allocate ( key, def_path_hash, address_space) ;
502502 assert_eq ! ( root_index, CRATE_DEF_INDEX ) ;
503- assert ! ( self . def_index_to_node[ address_space. index( ) ] . is_empty( ) ) ;
503+ debug_assert ! ( self . def_index_to_node[ address_space. index( ) ] . is_empty( ) ) ;
504504 self . def_index_to_node [ address_space. index ( ) ] . push ( ast:: CRATE_NODE_ID ) ;
505505 self . node_to_def_index . insert ( ast:: CRATE_NODE_ID , root_index) ;
506506
@@ -522,14 +522,15 @@ impl Definitions {
522522 debug ! ( "create_def_with_parent(parent={:?}, node_id={:?}, data={:?})" ,
523523 parent, node_id, data) ;
524524
525- assert ! ( !self . node_to_def_index. contains_key( & node_id) ,
526- "adding a def'n for node-id {:?} and data {:?} but a previous def'n exists: {:?}" ,
527- node_id,
528- data,
529- self . table. def_key( self . node_to_def_index[ & node_id] ) ) ;
525+ debug_assert ! ( !self . node_to_def_index. contains_key( & node_id) ,
526+ "adding a def'n for node-id {:?} and data {:?} \
527+ but a previous def'n exists: {:?}",
528+ node_id,
529+ data,
530+ self . table. def_key( self . node_to_def_index[ & node_id] ) ) ;
530531
531532 // The root node must be created with create_root_def()
532- assert ! ( data != DefPathData :: CrateRoot ) ;
533+ debug_assert ! ( data != DefPathData :: CrateRoot ) ;
533534
534535 // Find the next free disambiguator for this key.
535536 let disambiguator = {
@@ -581,8 +582,8 @@ impl Definitions {
581582 /// AST to HIR lowering.
582583 pub fn init_node_id_to_hir_id_mapping ( & mut self ,
583584 mapping : IndexVec < ast:: NodeId , hir:: HirId > ) {
584- assert ! ( self . node_to_hir_id. is_empty( ) ,
585- "Trying initialize NodeId -> HirId mapping twice" ) ;
585+ debug_assert ! ( self . node_to_hir_id. is_empty( ) ,
586+ "Trying initialize NodeId -> HirId mapping twice" ) ;
586587 self . node_to_hir_id = mapping;
587588 }
588589
0 commit comments