[COMMITTED 48/77] gccrs: Define constructor for LoadedCrate struct

[email protected]
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.rust
Message-ID <[email protected]>
From: Yap Zhi Heng <[email protected]>

Aggregate initialization does not compile properly for LoadedCrate in C++20.

gcc/rust/ChangeLog:

	* rust-session-manager.h (Session::LoadedCrate): Add explicit constructor.

Signed-off-by: Yap Zhi Heng <[email protected]>
---
 gcc/rust/rust-session-manager.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/rust/rust-session-manager.h b/gcc/rust/rust-session-manager.h
index af5a700b84b..0a6cc8117df 100644
--- a/gcc/rust/rust-session-manager.h
+++ b/gcc/rust/rust-session-manager.h
@@ -461,6 +461,11 @@ public:
 
   struct LoadedCrate
   {
+    LoadedCrate (std::string name, NodeId node_id,
+		 Resolver2_0::NameResolutionContext ctx)
+      : name (std::move (name)), node_id (node_id), ctx (std::move (ctx))
+    {}
+
     LoadedCrate (const LoadedCrate &) = delete;
     LoadedCrate &operator= (const LoadedCrate &) = delete;
     LoadedCrate (LoadedCrate &&other) = default;
-- 
2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.