diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-06-18 18:06:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-18 18:06:51 +0200 |
| commit | 2c4e0a91693f2fbe9693f19c292c05e5d55dc4ee (patch) | |
| tree | e52195e65b00276d2a2fc8d2564a17d3bfd62475 /compiler/rustc_ty_utils/src | |
| parent | ec295ad59c3e23fb68af78dc7fbf112614173545 (diff) | |
| parent | 8c83935cdf87d4e3c0d9e7796fc810fb54ecbf39 (diff) | |
| download | rust-2c4e0a91693f2fbe9693f19c292c05e5d55dc4ee.tar.gz rust-2c4e0a91693f2fbe9693f19c292c05e5d55dc4ee.zip | |
Rollup merge of #142619 - klensy:or_fun_call, r=nnethercote
apply clippy::or_fun_call Applies https://rust-lang.github.io/rust-clippy/master/index.html?groups=nursery#or_fun_call to reduce needless allocs.
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/layout.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 9774263e4c9..d5222822461 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -896,10 +896,9 @@ fn variant_info_for_coroutine<'tcx>( variant_size = variant_size.max(offset + field_layout.size); FieldInfo { kind: FieldKind::CoroutineLocal, - name: field_name.unwrap_or(Symbol::intern(&format!( - ".coroutine_field{}", - local.as_usize() - ))), + name: field_name.unwrap_or_else(|| { + Symbol::intern(&format!(".coroutine_field{}", local.as_usize())) + }), offset: offset.bytes(), size: field_layout.size.bytes(), align: field_layout.align.abi.bytes(), |
