@@ -1121,20 +1121,7 @@ impl Resolve {
11211121 world_id : WorldId ,
11221122 out_world_name : Option < String > ,
11231123 ) -> anyhow:: Result < ( ) > {
1124- // Rename the world to avoid having it get confused with the original
1125- // name of the world. Add `-importized` to it for now. Precisely how
1126- // this new world is created may want to be updated over time if this
1127- // becomes problematic.
1128- let world = & mut self . worlds [ world_id] ;
1129- let pkg = & mut self . packages [ world. package . unwrap ( ) ] ;
1130- pkg. worlds . shift_remove ( & world. name ) ;
1131- if let Some ( name) = out_world_name {
1132- world. name = name. clone ( ) ;
1133- pkg. worlds . insert ( name, world_id) ;
1134- } else {
1135- world. name . push_str ( "-importized" ) ;
1136- pkg. worlds . insert ( world. name . clone ( ) , world_id) ;
1137- }
1124+ self . rename_world ( world_id, out_world_name, "-importized" ) ;
11381125
11391126 // Trim all non-type definitions from imports. Types can be used by
11401127 // exported functions, for example, so they're preserved.
@@ -1162,7 +1149,7 @@ impl Resolve {
11621149
11631150 // Fill out any missing transitive interface imports by elaborating this
11641151 // world which does that for us.
1165- let world_span = self . worlds [ world_id ] . span ;
1152+ let world_span = world . span ;
11661153 self . elaborate_world ( world_id, world_span) ?;
11671154
11681155 #[ cfg( debug_assertions) ]
0 commit comments