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]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/ef5bf0e0183fc81701b17d93ad3911a172facdc8

The commit has NOT been mentioned in any issue.

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4705

 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 af5a700b8..0a6cc8117 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;

base-commit: f50d08d5f76127ee75502359c77e02af539ad0a2
-- 
2.54.0

Reply via email to