Skip to content

Commit ef5bf0e

Browse files
Polygonalrpowerboat9
authored andcommitted
gccrs: Define constructor for LoadedCrate struct
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 <yapzhhg@gmail.com>
1 parent f50d08d commit ef5bf0e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

gcc/rust/rust-session-manager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ struct Session
461461

462462
struct LoadedCrate
463463
{
464+
LoadedCrate (std::string name, NodeId node_id,
465+
Resolver2_0::NameResolutionContext ctx)
466+
: name (std::move (name)), node_id (node_id), ctx (std::move (ctx))
467+
{}
468+
464469
LoadedCrate (const LoadedCrate &) = delete;
465470
LoadedCrate &operator= (const LoadedCrate &) = delete;
466471
LoadedCrate (LoadedCrate &&other) = default;

0 commit comments

Comments
 (0)