Skip to content

Commit 3ac18cb

Browse files
osiewiczbjorn3
andauthored
Apply suggestions from code review
Co-authored-by: bjorn3 <[email protected]>
1 parent a3de0b5 commit 3ac18cb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,7 @@ fn exported_symbols_provider_local(
332332
rustc_middle::ty::CoroutineClosure(def_id, _) => *def_id,
333333
rustc_middle::ty::CoroutineWitness(def_id, _) => *def_id,
334334
rustc_middle::ty::Foreign(def_id) => *def_id,
335-
_ => {
336-
return false;
337-
}
335+
_ => return false,
338336
};
339337
let Some(root_def_id) = root_def_id.as_local() else {
340338
return false;
@@ -347,10 +345,7 @@ fn exported_symbols_provider_local(
347345
let is_instantiable_downstream = |did, type_args| {
348346
std::iter::once(tcx.type_of(did).skip_binder()).chain(type_args).all(|arg| {
349347
arg.walk().all(|ty| {
350-
let Some(ty) = ty.as_type() else {
351-
return true;
352-
};
353-
!is_local_to_current_crate(ty)
348+
ty.as_type().map_or(true, |ty| !is_local_to_current_crate(ty))
354349
})
355350
})
356351
};

0 commit comments

Comments
 (0)