@@ -211,21 +211,22 @@ impl<'tcx> ReachableContext<'tcx> {
211
211
if !self . any_library {
212
212
// If we are building an executable, only explicitly extern
213
213
// types need to be exported.
214
- if let Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Fn ( sig, ..) , def_id, .. } )
215
- | Node :: ImplItem ( hir:: ImplItem {
216
- kind : hir:: ImplItemKind :: Fn ( sig, ..) ,
217
- def_id,
218
- ..
219
- } ) = * node
220
- {
221
- let reachable = sig. header . abi != Abi :: Rust ;
222
- let codegen_attrs = self . tcx . codegen_fn_attrs ( * def_id) ;
223
- let is_extern = codegen_attrs. contains_extern_indicator ( ) ;
224
- let std_internal =
225
- codegen_attrs. flags . contains ( CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL ) ;
226
- if reachable || is_extern || std_internal {
227
- self . reachable_symbols . insert ( search_item) ;
228
- }
214
+ let reachable =
215
+ if let Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Fn ( sig, ..) , .. } )
216
+ | Node :: ImplItem ( hir:: ImplItem {
217
+ kind : hir:: ImplItemKind :: Fn ( sig, ..) , ..
218
+ } ) = * node
219
+ {
220
+ sig. header . abi != Abi :: Rust
221
+ } else {
222
+ false
223
+ } ;
224
+ let codegen_attrs = self . tcx . codegen_fn_attrs ( search_item) ;
225
+ let is_extern = codegen_attrs. contains_extern_indicator ( ) ;
226
+ let std_internal =
227
+ codegen_attrs. flags . contains ( CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL ) ;
228
+ if reachable || is_extern || std_internal {
229
+ self . reachable_symbols . insert ( search_item) ;
229
230
}
230
231
} else {
231
232
// If we are building a library, then reachable symbols will
0 commit comments