diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index 47cd034660c..ba07358dc55 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -186,6 +186,11 @@ ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment, } } + // 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);