Skip to content

Commit 61b9a51

Browse files
authored
Rollup merge of rust-lang#52824 - varkor:fix-llvm-ret-move-warnings, r=rkruppe
Fix -Wpessimizing-move warnings in rustllvm/PassWrapper These are producing warnings when building rustc (`warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]`).
2 parents 9e43ebd + 9ccd7ee commit 61b9a51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rustllvm/PassWrapper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
10751075
auto MOrErr = getLazyBitcodeModule(Memory, Context, true, true);
10761076

10771077
if (!MOrErr)
1078-
return std::move(MOrErr);
1078+
return MOrErr;
10791079

10801080
// The rest of this closure is a workaround for
10811081
// https://bugs.llvm.org/show_bug.cgi?id=38184 where during ThinLTO imports
@@ -1093,14 +1093,14 @@ LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
10931093
// shouldn't be a perf hit.
10941094
if (Error Err = (*MOrErr)->materializeMetadata()) {
10951095
Expected<std::unique_ptr<Module>> Ret(std::move(Err));
1096-
return std::move(Ret);
1096+
return Ret;
10971097
}
10981098

10991099
auto *WasmCustomSections = (*MOrErr)->getNamedMetadata("wasm.custom_sections");
11001100
if (WasmCustomSections)
11011101
WasmCustomSections->eraseFromParent();
11021102

1103-
return std::move(MOrErr);
1103+
return MOrErr;
11041104
};
11051105
FunctionImporter Importer(Data->Index, Loader);
11061106
Expected<bool> Result = Importer.importFunctions(Mod, ImportList);

0 commit comments

Comments
 (0)