From 8f907eb1e2cab65435a489ec98ffb263ac1bf826 Mon Sep 17 00:00:00 2001 From: Builder Date: Mon, 10 Nov 2025 22:29:49 +0000 Subject: [PATCH] Don't report link-self-contained not being supported if it's turned off. --- compiler/rustc_codegen_ssa/src/back/link.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index c5724c20b2165..bb12669db875c 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1798,7 +1798,7 @@ fn self_contained_components( if let Some(self_contained) = sess.opts.cg.link_self_contained.explicitly_set { // Emit an error if the user requested self-contained mode on the CLI but the target // explicitly refuses it. - if sess.target.link_self_contained.is_disabled() { + if sess.target.link_self_contained.is_disabled() && self_contained { sess.dcx().emit_err(errors::UnsupportedLinkSelfContained); } self_contained