Skip to content

Commit 1e0df88

Browse files
authored
Rollup merge of #104517 - dfordivam:patch-1, r=cuviper
Throw error on failure in loading llvm-plugin The following code silently ignores the error as the `LLVMRustSetLastError` only tracks one error at a time. At all other places where `LLVMRustSetLastError` is used the code immediately returns. https://github.com/rust-lang/rust/blob/251831ece9601d64172127b6caae9087358c2386/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L801-L804
2 parents 5197ef6 + 693c631 commit 1e0df88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ LLVMRustOptimize(
800800
auto Plugin = PassPlugin::Load(PluginPath.str());
801801
if (!Plugin) {
802802
LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
803-
continue;
803+
return LLVMRustResult::Failure;
804804
}
805805
Plugin->registerPassBuilderCallbacks(PB);
806806
}

0 commit comments

Comments
 (0)