aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-base.cc
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2025-03-27 15:15:08 +0000
committerPhilip Herron <philip.herron@embecosm.com>2025-03-27 16:35:26 +0000
commit29cace33c167fd22cf91f3f2f982e70f082db69f (patch)
tree6ce1e507c3c174e8ce672b8d3840f738ce9f88b7 /gcc/rust/backend/rust-compile-base.cc
parent1a2f56a9d529f39ccbd72ec9fa5b5ccb8c3e6737 (diff)
downloadgcc-29cace33c167fd22cf91f3f2f982e70f082db69f.zip
gcc-29cace33c167fd22cf91f3f2f982e70f082db69f.tar.gz
gcc-29cace33c167fd22cf91f3f2f982e70f082db69f.tar.bz2
gccrs: Give the builtin unit struct an actual locus
This has been a pet peeve of mine for a while because the gimple never emitted the struct () name properly it was always empty which for record types they always require a real locus or they dont get a proper name. gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::unit_expression): pass ctx * backend/rust-compile-base.h: cant be static * backend/rust-compile-intrinsic.cc (try_handler_inner): pass ctx * backend/rust-compile-type.cc (TyTyResolveCompile::get_unit_type): update to grab the first locus (TyTyResolveCompile::visit): pass ctx * backend/rust-compile-type.h: likewise Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.cc')
-rw-r--r--gcc/rust/backend/rust-compile-base.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index c71417d..d8a71f5 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -1023,7 +1023,7 @@ HIRCompileBase::resolve_method_address (TyTy::FnType *fntype,
tree
HIRCompileBase::unit_expression (location_t locus)
{
- tree unit_type = TyTyResolveCompile::get_unit_type ();
+ tree unit_type = TyTyResolveCompile::get_unit_type (ctx);
return Backend::constructor_expression (unit_type, false, {}, -1, locus);
}