diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-04-12 10:47:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 10:47:17 +0000 |
commit | a5b38698aa439a935f0c0f4c55611f2173a28b57 (patch) | |
tree | 45de8c3ff3d26871c2ecab1e9c1e1d9e543a81b0 /gcc/rust/backend/rust-compile-base.cc | |
parent | c1a022385f5ed99b579e373d37cec389433e93f4 (diff) | |
parent | 9f5d8a89738cd157205762d2e17b2bbc68b8333c (diff) | |
download | gcc-a5b38698aa439a935f0c0f4c55611f2173a28b57.zip gcc-a5b38698aa439a935f0c0f4c55611f2173a28b57.tar.gz gcc-a5b38698aa439a935f0c0f4c55611f2173a28b57.tar.bz2 |
Merge #1103
1103: Lower AST::Visibility to HIR::Visibility properly r=CohenArthur a=CohenArthur
Fixes #1093
This should cover every case since the previous code simply created public HIR visibilities.
The PR refactors the HIR::Visibility struct to be tinier and a desugared version of the AST one.
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-base.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc index a705da7..602fc56 100644 --- a/gcc/rust/backend/rust-compile-base.cc +++ b/gcc/rust/backend/rust-compile-base.cc @@ -37,8 +37,7 @@ HIRCompileBase::setup_attributes_on_fndecl ( { // if its the main fn or pub visibility mark its as DECL_PUBLIC // please see https://github.com/Rust-GCC/gccrs/pull/137 - bool is_pub - = visibility.get_vis_type () != HIR::Visibility::PublicVisType::NONE; + bool is_pub = visibility.get_vis_type () == HIR::Visibility::VisType::PUBLIC; if (is_main_entry_point || is_pub) { TREE_PUBLIC (fndecl) = 1; |