lazily calls some fns
This commit is contained in:
parent
e423058751
commit
229d199994
7 changed files with 14 additions and 13 deletions
|
@ -216,9 +216,10 @@ impl<'tcx> InstanceDef<'tcx> {
|
|||
// drops of `Option::None` before LTO. We also respect the intent of
|
||||
// `#[inline]` on `Drop::drop` implementations.
|
||||
return ty.ty_adt_def().map_or(true, |adt_def| {
|
||||
adt_def.destructor(tcx).map_or(adt_def.is_enum(), |dtor| {
|
||||
tcx.codegen_fn_attrs(dtor.did).requests_inline()
|
||||
})
|
||||
adt_def.destructor(tcx).map_or_else(
|
||||
|| adt_def.is_enum(),
|
||||
|dtor| tcx.codegen_fn_attrs(dtor.did).requests_inline(),
|
||||
)
|
||||
});
|
||||
}
|
||||
tcx.codegen_fn_attrs(self.def_id()).requests_inline()
|
||||
|
|
|
@ -525,7 +525,7 @@ impl<'sess> OnDiskCache<'sess> {
|
|||
) {
|
||||
let mut current_diagnostics = self.current_diagnostics.borrow_mut();
|
||||
|
||||
let x = current_diagnostics.entry(dep_node_index).or_insert(Vec::new());
|
||||
let x = current_diagnostics.entry(dep_node_index).or_default();
|
||||
|
||||
x.extend(Into::<Vec<_>>::into(diagnostics));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue