diff options
| author | bors <bors@rust-lang.org> | 2025-07-28 05:25:23 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-28 05:25:23 +0000 | 
| commit | d242a8bd5a73f633ba1ec5aacf19acf35a3c747d (patch) | |
| tree | 0c2c8a3f7ebcbd838f4afef27acad292c7b0bab1 /compiler/rustc_codegen_ssa/src | |
| parent | 733dab558992d902d6d17576de1da768094e2cf3 (diff) | |
| parent | b8eb046e6ee3294969bf8faf31da226b0ea29d18 (diff) | |
| download | rust-d242a8bd5a73f633ba1ec5aacf19acf35a3c747d.tar.gz rust-d242a8bd5a73f633ba1ec5aacf19acf35a3c747d.zip | |
Auto merge of #144469 - Kivooeo:chains-cleanup, r=SparrowLii
Some `let chains` clean-up Not sure if this kind of clean-up is welcoming because of size, but I decided to try out one r? compiler
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 20 | 
2 files changed, 15 insertions, 17 deletions
| diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 5ce301c0eb9..162fbf3d6e2 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -3369,12 +3369,12 @@ fn warn_if_linked_with_gold(sess: &Session, path: &Path) -> Result<(), Box<dyn s let section = elf.sections(endian, data)?.section_by_name(endian, b".note.gnu.gold-version"); - if let Some((_, section)) = section { - if let Some(mut notes) = section.notes(endian, data)? { - return Ok(notes.any(|note| { - note.is_ok_and(|note| note.n_type(endian) == elf::NT_GNU_GOLD_VERSION) - })); - } + if let Some((_, section)) = section + && let Some(mut notes) = section.notes(endian, data)? + { + return Ok(notes.any(|note| { + note.is_ok_and(|note| note.n_type(endian) == elf::NT_GNU_GOLD_VERSION) + })); } Ok(false) diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index 3f456fa115a..e187331c696 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -496,17 +496,15 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs { ) .with_note("Rustc requires this item to have a specific mangled name.") .with_span_label(tcx.def_span(did), "should be the internal language item"); - if let Some(lang_item) = lang_item { - if let Some(link_name) = lang_item.link_name() { - err = err - .with_note("If you are trying to prevent mangling to ease debugging, many") - .with_note(format!( - "debuggers support a command such as `rbreak {link_name}` to" - )) - .with_note(format!( - "match `.*{link_name}.*` instead of `break {link_name}` on a specific name" - )) - } + if let Some(lang_item) = lang_item + && let Some(link_name) = lang_item.link_name() + { + err = err + .with_note("If you are trying to prevent mangling to ease debugging, many") + .with_note(format!("debuggers support a command such as `rbreak {link_name}` to")) + .with_note(format!( + "match `.*{link_name}.*` instead of `break {link_name}` on a specific name" + )) } err.emit(); } | 
