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> {
111
111
( self . cstore ( ) . crate_name_untracked ( def_id. krate ) , None )
112
112
} else {
113
113
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)
120
125
} ;
121
126
122
127
// Allocate and return a new module with the information we found
You can’t perform that action at this time.
0 commit comments