diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-07-25 16:56:17 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-08-05 16:37:00 +0200 |
commit | 4dc145a41507f7ee7be87a1f825b67a65437abe4 (patch) | |
tree | 38342eda9cbf0ff58090898fe94111c9bdbbfe32 /gcc/rust/hir/tree/rust-hir-pattern.h | |
parent | 948e4a63455c090afd491c7b669896d47ae08559 (diff) | |
download | gcc-4dc145a41507f7ee7be87a1f825b67a65437abe4.zip gcc-4dc145a41507f7ee7be87a1f825b67a65437abe4.tar.gz gcc-4dc145a41507f7ee7be87a1f825b67a65437abe4.tar.bz2 |
gccrs: Refactor substitution param mapping to be more abstract
This is an initial patch required to refactor our generics code to be
simpler and more abstract so we return the HIR::GenericParam in ParamMappings
instead of assuming its a TypeParam so we can slowly introduce ConstGenericParam
into this same flow.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.cc: check for type param
* typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::SubstitutionParamMapping):
return HIR::GenericParam base class
(SubstitutionParamMapping::get_generic_param): likewise
(SubstitutionParamMapping::get_type_representation): new helper
(SubstitutionParamMapping::param_has_default_ty): check for param type
(SubstitutionParamMapping::get_default_ty): likewise
* typecheck/rust-tyty-subst.h: get the locus from the subst HIR::GenericParam now
* typecheck/rust-tyty-variance-analysis.cc (GenericTyPerCrateCtx::debug_print_solutions):
likwise
(GenericTyVisitorCtx::process_type): likewise
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/hir/tree/rust-hir-pattern.h')
0 files changed, 0 insertions, 0 deletions