Skip to content

Commit e4cf123

Browse files
committed
cpp2rust driver: run runstfmt on our fixed stable version
1 parent 1b372c1 commit e4cf123

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

cpp2rust/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ target_compile_definitions(cpp2rust_core PUBLIC "-DCLANG_C_COMPILER=\"${CMAKE_C_
2424
target_compile_definitions(cpp2rust_core PUBLIC "-DCLANG_CXX_COMPILER=\"${CMAKE_CXX_COMPILER}\"")
2525
target_compile_definitions(cpp2rust_core PUBLIC "-DCLANG_RESOURCE_DIR=\"${LLVM_LIBRARY_DIR}/clang/${LLVM_VERSION_MAJOR}\"")
2626
target_compile_definitions(cpp2rust_core PUBLIC "-DCOMPAT_INCLUDE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/compat\"")
27+
target_compile_definitions(cpp2rust_core PUBLIC "-DRUST_STABLE_VERSION=\"${RUST_STABLE_VERSION}\"")
2728

2829
if (APPLE)
2930
execute_process(

cpp2rust/cpp2rust.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ int main(int argc, char *argv[]) {
190190
file.close();
191191

192192
// call rustfmt.
193-
std::string rustfmt_command = "rustfmt --edition 2024 " + RsFile;
193+
std::string rustfmt_command =
194+
"rustfmt +" RUST_STABLE_VERSION " --edition 2024 " + RsFile;
194195
if (std::system(rustfmt_command.c_str()) != 0) {
195196
llvm::errs() << "ERROR: failed to run rustfmt\n";
196197
return EXIT_FAILURE;

0 commit comments

Comments
 (0)