Skip to content

Commit fdf8751

Browse files
authored
Rollup merge of rust-lang#102337 - cuviper:llvm-optional-bool, r=nikic
Avoid LLVM-deprecated `Optional::hasValue` LLVM 15 added `Optional::has_value`, and LLVM `main` (16) has deprecated `hasValue`. However, its `explicit operator bool` does the same thing, and was added long ago, so we can use that across our full LLVM range of compatibility.
2 parents 79de0e4 + 35adb36 commit fdf8751

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
@@ -1044,7 +1044,7 @@ extern "C" void LLVMRustSetModulePIELevel(LLVMModuleRef M) {
10441044
extern "C" void LLVMRustSetModuleCodeModel(LLVMModuleRef M,
10451045
LLVMRustCodeModel Model) {
10461046
auto CM = fromRust(Model);
1047-
if (!CM.hasValue())
1047+
if (!CM)
10481048
return;
10491049
unwrap(M)->setCodeModel(*CM);
10501050
}

0 commit comments

Comments
 (0)