@@ -553,20 +553,20 @@ impl NameBindings {
553553 let type_def = self . type_def . borrow ( ) . clone ( ) ;
554554 match type_def {
555555 None => {
556- self . type_def . set ( Some ( TypeNsDef {
556+ * self . type_def . borrow_mut ( ) = Some ( TypeNsDef {
557557 is_public : is_public,
558558 module_def : Some ( module_) ,
559559 type_def : None ,
560560 type_span : Some ( sp)
561- } ) ) ;
561+ } ) ;
562562 }
563563 Some ( type_def) => {
564- self . type_def . set ( Some ( TypeNsDef {
564+ * self . type_def . borrow_mut ( ) = Some ( TypeNsDef {
565565 is_public : is_public,
566566 module_def : Some ( module_) ,
567567 type_span : Some ( sp) ,
568568 type_def : type_def. type_def
569- } ) ) ;
569+ } ) ;
570570 }
571571 }
572572 }
@@ -584,12 +584,12 @@ impl NameBindings {
584584 None => {
585585 let module = @Module :: new ( parent_link, def_id, kind,
586586 external, is_public) ;
587- self . type_def . set ( Some ( TypeNsDef {
587+ * self . type_def . borrow_mut ( ) = Some ( TypeNsDef {
588588 is_public : is_public,
589589 module_def : Some ( module) ,
590590 type_def : None ,
591591 type_span : None ,
592- } ) )
592+ } ) ;
593593 }
594594 Some ( type_def) => {
595595 match type_def. module_def {
@@ -599,12 +599,12 @@ impl NameBindings {
599599 kind,
600600 external,
601601 is_public) ;
602- self . type_def . set ( Some ( TypeNsDef {
602+ * self . type_def . borrow_mut ( ) = Some ( TypeNsDef {
603603 is_public : is_public,
604604 module_def : Some ( module) ,
605605 type_def : type_def. type_def ,
606606 type_span : None ,
607- } ) )
607+ } ) ;
608608 }
609609 Some ( module_def) => module_def. kind . set ( kind) ,
610610 }
@@ -618,31 +618,31 @@ impl NameBindings {
618618 let type_def = self . type_def . borrow ( ) . clone ( ) ;
619619 match type_def {
620620 None => {
621- self . type_def . set ( Some ( TypeNsDef {
621+ * self . type_def . borrow_mut ( ) = Some ( TypeNsDef {
622622 module_def : None ,
623623 type_def : Some ( def) ,
624624 type_span : Some ( sp) ,
625625 is_public : is_public,
626- } ) ) ;
626+ } ) ;
627627 }
628628 Some ( type_def) => {
629- self . type_def . set ( Some ( TypeNsDef {
629+ * self . type_def . borrow_mut ( ) = Some ( TypeNsDef {
630630 type_def : Some ( def) ,
631631 type_span : Some ( sp) ,
632632 module_def : type_def. module_def ,
633633 is_public : is_public,
634- } ) ) ;
634+ } ) ;
635635 }
636636 }
637637 }
638638
639639 /// Records a value definition.
640640 fn define_value ( & self , def : Def , sp : Span , is_public : bool ) {
641- self . value_def . set ( Some ( ValueNsDef {
641+ * self . value_def . borrow_mut ( ) = Some ( ValueNsDef {
642642 def : def,
643643 value_span : Some ( sp) ,
644644 is_public : is_public,
645- } ) ) ;
645+ } ) ;
646646 }
647647
648648 /// Returns the module node if applicable.
@@ -2417,8 +2417,8 @@ impl<'a> Resolver<'a> {
24172417 match value_result {
24182418 BoundResult ( target_module, name_bindings) => {
24192419 debug ! ( "(resolving single import) found value target" ) ;
2420- import_resolution. value_target . set (
2421- Some ( Target :: new ( target_module, name_bindings) ) ) ;
2420+ * import_resolution. value_target . borrow_mut ( ) =
2421+ Some ( Target :: new ( target_module, name_bindings) ) ;
24222422 import_resolution. value_id . set ( directive. id ) ;
24232423 value_used_public = name_bindings. defined_in_public_namespace ( ValueNS ) ;
24242424 }
@@ -2431,8 +2431,8 @@ impl<'a> Resolver<'a> {
24312431 BoundResult ( target_module, name_bindings) => {
24322432 debug ! ( "(resolving single import) found type target: {:?}" ,
24332433 { name_bindings. type_def. borrow( ) . clone( ) . unwrap( ) . type_def } ) ;
2434- import_resolution. type_target . set (
2435- Some ( Target :: new ( target_module, name_bindings) ) ) ;
2434+ * import_resolution. type_target . borrow_mut ( ) =
2435+ Some ( Target :: new ( target_module, name_bindings) ) ;
24362436 import_resolution. type_id . set ( directive. id ) ;
24372437 type_used_public = name_bindings. defined_in_public_namespace ( TypeNS ) ;
24382438 }
@@ -2537,10 +2537,10 @@ impl<'a> Resolver<'a> {
25372537 // Simple: just copy the old import resolution.
25382538 let new_import_resolution =
25392539 @ImportResolution :: new ( id, is_public) ;
2540- new_import_resolution. value_target . set (
2541- get ( & target_import_resolution. value_target ) ) ;
2542- new_import_resolution. type_target . set (
2543- get ( & target_import_resolution. type_target ) ) ;
2540+ * new_import_resolution. value_target . borrow_mut ( ) =
2541+ get ( & target_import_resolution. value_target ) ;
2542+ * new_import_resolution. type_target . borrow_mut ( ) =
2543+ get ( & target_import_resolution. type_target ) ;
25442544
25452545 import_resolutions. insert
25462546 ( * ident, new_import_resolution) ;
@@ -2554,17 +2554,15 @@ impl<'a> Resolver<'a> {
25542554 // Continue.
25552555 }
25562556 Some ( value_target) => {
2557- dest_import_resolution. value_target . set (
2558- Some ( value_target) ) ;
2557+ * dest_import_resolution. value_target . borrow_mut ( ) = Some ( value_target) ;
25592558 }
25602559 }
25612560 match * target_import_resolution. type_target . borrow ( ) {
25622561 None => {
25632562 // Continue.
25642563 }
25652564 Some ( type_target) => {
2566- dest_import_resolution. type_target . set (
2567- Some ( type_target) ) ;
2565+ * dest_import_resolution. type_target . borrow_mut ( ) = Some ( type_target) ;
25682566 }
25692567 }
25702568 dest_import_resolution. is_public . set ( is_public) ;
@@ -2636,14 +2634,14 @@ impl<'a> Resolver<'a> {
26362634 // Merge the child item into the import resolution.
26372635 if name_bindings. defined_in_public_namespace ( ValueNS ) {
26382636 debug ! ( "(resolving glob import) ... for value target" ) ;
2639- dest_import_resolution. value_target . set (
2640- Some ( Target :: new ( containing_module, name_bindings) ) ) ;
2637+ * dest_import_resolution. value_target . borrow_mut ( ) =
2638+ Some ( Target :: new ( containing_module, name_bindings) ) ;
26412639 dest_import_resolution. value_id . set ( id) ;
26422640 }
26432641 if name_bindings. defined_in_public_namespace ( TypeNS ) {
26442642 debug ! ( "(resolving glob import) ... for type target" ) ;
2645- dest_import_resolution. type_target . set (
2646- Some ( Target :: new ( containing_module, name_bindings) ) ) ;
2643+ * dest_import_resolution. type_target . borrow_mut ( ) =
2644+ Some ( Target :: new ( containing_module, name_bindings) ) ;
26472645 dest_import_resolution. type_id . set ( id) ;
26482646 }
26492647 dest_import_resolution. is_public . set ( is_public) ;
0 commit comments