Skip to content

Commit 6d42548

Browse files
committed
rust-session-manager: fix an issue where ...
... the -frust-crate= option got incorrectly overridden by a default value Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
1 parent 9011184 commit 6d42548

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gcc/rust/rust-session-manager.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,9 @@ Session::init ()
311311
// setup backend to GCC GIMPLE
312312
backend = rust_get_backend ();
313313

314-
// set the default crate name
315-
options.set_crate_name (kDefaultCrateName);
314+
// set the default crate name if crate name was unset
315+
if (options.crate_name.empty ())
316+
options.set_crate_name (kDefaultCrateName);
316317
}
317318

318319
/* Initialise default options. Actually called before handle_option, unlike init

0 commit comments

Comments
 (0)