File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,17 @@ impl<'a> Resolver<'a> {
111111 ( self . cstore ( ) . crate_name_untracked ( def_id. krate ) , None )
112112 } else {
113113 let def_key = self . cstore ( ) . def_key ( def_id) ;
114- (
115- // This unwrap is safe: crates must always have a name
116- def_key. disambiguated_data . data . get_opt_name ( ) . unwrap ( ) ,
117- // This unwrap is safe since we know this isn't the root
118- Some ( self . get_module ( DefId { index : def_key. parent . unwrap ( ) , ..def_id } ) ) ,
119- )
114+ let name = def_key
115+ . disambiguated_data
116+ . data
117+ . get_opt_name ( )
118+ . expect ( "given a DefId that wasn't a module" ) ;
119+ // This unwrap is safe since we know this isn't the root
120+ let parent = Some ( self . get_module ( DefId {
121+ index : def_key. parent . expect ( "failed to get parent for module" ) ,
122+ ..def_id
123+ } ) ) ;
124+ ( name, parent)
120125 } ;
121126
122127 // Allocate and return a new module with the information we found
You can’t perform that action at this time.
0 commit comments