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>
This commit is contained in:
bors[bot] 2022-04-06 11:00:42 +00:00 committed by GitHub
commit 779de323f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -311,7 +311,7 @@ Visibility::as_string () const
case NONE:
return std::string ("pub");
case CRATE:
return std::string ("ub(crate)");
return std::string ("pub(crate)");
case SELF:
return std::string ("pub(self)");
case SUPER:

View File

@ -311,8 +311,9 @@ Session::init ()
// setup backend to GCC GIMPLE
backend = rust_get_backend ();
// set the default crate name
options.set_crate_name (kDefaultCrateName);
// set the default crate name if crate name was unset
if (options.crate_name.empty ())
options.set_crate_name (kDefaultCrateName);
}
/* Initialise default options. Actually called before handle_option, unlike init