diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2025-01-13 18:26:37 +0100 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2025-01-29 10:45:07 +0000 |
commit | 7ba77d01d77e58ed707fbc6ff6bd9f23e6dfeb22 (patch) | |
tree | 13dc43435ec5131ae5405337f937174d0433b78b /gcc | |
parent | 05348933bd4708a91bfce94720890f7d6fac615f (diff) | |
download | gcc-7ba77d01d77e58ed707fbc6ff6bd9f23e6dfeb22.zip gcc-7ba77d01d77e58ed707fbc6ff6bd9f23e6dfeb22.tar.gz gcc-7ba77d01d77e58ed707fbc6ff6bd9f23e6dfeb22.tar.bz2 |
Compile unit struct with constructor
gcc/rust/ChangeLog:
* backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Do
not use query system for unit struct but compile it's constructor
instead.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/backend/rust-compile-resolve-path.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index 8752d8f..07fa9b2 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -180,6 +180,11 @@ ResolvePathRef::resolve_with_node_id ( } } + // Handle unit struct + if (lookup->get_kind () == TyTy::TypeKind::ADT) + return attempt_constructor_expression_lookup (lookup, ctx, mappings, + expr_locus); + // let the query system figure it out tree resolved_item = query_compile (ref, lookup, final_segment, mappings, expr_locus, is_qualified_path); |