Skip to content

Commit 779de32

Browse files
bors[bot]liushuyu
andauthored
Merge #1083
1083: bugfix: fix several minor issues r=CohenArthur a=liushuyu - Fixed `-frust-crate= option` got incorrectly overridden by a default value (`example`) - Fix a minor typo in `gcc/rust/ast/rust-ast-full-test.cc` Co-authored-by: liushuyu <liushuyu011@gmail.com>
2 parents 9011184 + af14ad6 commit 779de32

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gcc/rust/ast/rust-ast-full-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ Visibility::as_string () const
311311
case NONE:
312312
return std::string ("pub");
313313
case CRATE:
314-
return std::string ("ub(crate)");
314+
return std::string ("pub(crate)");
315315
case SELF:
316316
return std::string ("pub(self)");
317317
case SUPER:

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)