diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-02-20 16:22:20 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-08-01 13:11:30 +0200 |
commit | 07fc78500f6fbd365aebf98cfd9b8c7760f6692b (patch) | |
tree | f96a8fad2f30fa1d260814ba3e2e6be38dc72d37 /gcc/rust/hir/tree | |
parent | 26e77295e77e5e008e0aa43837edd293ca12179e (diff) | |
download | gcc-07fc78500f6fbd365aebf98cfd9b8c7760f6692b.zip gcc-07fc78500f6fbd365aebf98cfd9b8c7760f6692b.tar.gz gcc-07fc78500f6fbd365aebf98cfd9b8c7760f6692b.tar.bz2 |
gccrs: extern-types: Lower to HIR::ExternalTypeItem properly
gcc/rust/ChangeLog:
* hir/rust-ast-lower-extern.h: Lower to HIR::ExternalTypeItem nodes.
* hir/tree/rust-hir-item.h (class ExternalTypeItem): Create private
visibility by default as extern types have no visibility - add a comment
about the correctness of this.
Diffstat (limited to 'gcc/rust/hir/tree')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-item.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h index 40093a2..3bd0102 100644 --- a/gcc/rust/hir/tree/rust-hir-item.h +++ b/gcc/rust/hir/tree/rust-hir-item.h @@ -3152,16 +3152,20 @@ protected: class ExternalTypeItem : public ExternalItem { +public: ExternalTypeItem (Analysis::NodeMapping mappings, Identifier item_name, - Visibility vis, AST::AttrVec outer_attrs, location_t locus) + location_t locus) : ExternalItem (std::move (mappings), std::move (item_name), - std::move (vis), std::move (outer_attrs), locus) + Visibility (Visibility::PRIVATE), + /* FIXME: Is that correct? */ + {}, locus) {} ExternalTypeItem (ExternalTypeItem const &other) : ExternalItem (other) {} ExternalTypeItem (ExternalTypeItem &&other) = default; ExternalTypeItem &operator= (ExternalTypeItem &&other) = default; + ExternalTypeItem &operator= (ExternalTypeItem const &other) = default; std::string as_string () const override; @@ -3171,6 +3175,8 @@ class ExternalTypeItem : public ExternalItem ExternKind get_extern_kind () override { return ExternKind::Type; } protected: + /* Use covariance to implement clone function as returning this object + * rather than base */ ExternalTypeItem *clone_external_item_impl () const override { return new ExternalTypeItem (*this); |