From fd470e58c2282755bc6cbd5ef318577d2eb10322 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sat, 10 Feb 2024 20:20:16 +0100 Subject: [PATCH] Adapt `llvm-has-rust-patches` validation to take `llvm-config` into account. --- src/bootstrap/src/core/config/config.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index c0dd1e1208484..4c64850c0e04b 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1810,10 +1810,9 @@ impl Config { target.llvm_config = Some(config.src.join(s)); } if let Some(patches) = cfg.llvm_has_rust_patches { - assert_eq!( - config.submodules, - Some(false), - "cannot set `llvm-has-rust-patches` for a managed submodule (set `build.submodules = false` if you want to apply patches)" + assert!( + config.submodules == Some(false) || cfg.llvm_config.is_some(), + "use of `llvm-has-rust-patches` is restricted to cases where either submodules are disabled or llvm-config been provided" ); target.llvm_has_rust_patches = Some(patches); }