public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Store visibility properly in ExternalTypeItem
@ 2024-05-07 16:23 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2024-05-07 16:23 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:aa395781afdcf06cac36dec414e90c741ec5a00b
commit aa395781afdcf06cac36dec414e90c741ec5a00b
Author: jjasmine <tanghocle456@gmail.com>
Date: Sat Mar 9 17:16:34 2024 -0500
Store visibility properly in ExternalTypeItem
Fix issue 2897
gcc/rust/ChangeLog:
* hir/rust-ast-lower-extern.h: Add translate_visiblity
* hir/tree/rust-hir-item.h: Fix constructor of ExternalTypeItem
Diff:
---
gcc/rust/hir/rust-ast-lower-extern.h | 4 +++-
gcc/rust/hir/tree/rust-hir-item.h | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gcc/rust/hir/rust-ast-lower-extern.h b/gcc/rust/hir/rust-ast-lower-extern.h
index e92acdc44a1f..bd889e244b01 100644
--- a/gcc/rust/hir/rust-ast-lower-extern.h
+++ b/gcc/rust/hir/rust-ast-lower-extern.h
@@ -133,8 +133,10 @@ public:
mappings->get_next_hir_id (crate_num),
mappings->get_next_localdef_id (crate_num));
+ HIR::Visibility vis = translate_visibility (type.get_visibility ());
+
translated = new HIR::ExternalTypeItem (mapping, type.get_identifier (),
- type.get_locus ());
+ vis, type.get_locus ());
}
private:
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 3bd0102d4dcf..7e0c8c6ffca9 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -3154,9 +3154,9 @@ class ExternalTypeItem : public ExternalItem
{
public:
ExternalTypeItem (Analysis::NodeMapping mappings, Identifier item_name,
- location_t locus)
+ Visibility vis, location_t locus)
: ExternalItem (std::move (mappings), std::move (item_name),
- Visibility (Visibility::PRIVATE),
+ Visibility (std::move (vis)),
/* FIXME: Is that correct? */
{}, locus)
{}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-07 16:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07 16:23 [gcc/devel/rust/master] Store visibility properly in ExternalTypeItem Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).