diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-08-11 20:15:04 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-08-19 14:36:10 +0100 |
commit | 3f877a690dccd5faf5b75ad7b75e0bd85f0a5be4 (patch) | |
tree | 3fdb0c7679bd72be4e0b8de64ab5d02efc106814 /gcc | |
parent | b9c1a73e6d8331f8b4e5bc9bdba8ddda29c8007f (diff) | |
download | gcc-3f877a690dccd5faf5b75ad7b75e0bd85f0a5be4.zip gcc-3f877a690dccd5faf5b75ad7b75e0bd85f0a5be4.tar.gz gcc-3f877a690dccd5faf5b75ad7b75e0bd85f0a5be4.tar.bz2 |
Add missing mappings for trait-items
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-implitem.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-implitem.h b/gcc/rust/hir/rust-ast-lower-implitem.h index f50e66f..b2c7b13 100644 --- a/gcc/rust/hir/rust-ast-lower-implitem.h +++ b/gcc/rust/hir/rust-ast-lower-implitem.h @@ -375,6 +375,15 @@ public: mapping.get_hirid (), translated); mappings->insert_location (crate_num, mapping.get_hirid (), trait_item->get_locus ()); + + // add the mappings for the function params at the end + for (auto ¶m : trait_item->get_decl ().get_function_params ()) + { + mappings->insert_hir_param (mapping.get_crate_num (), + param.get_mappings ().get_hirid (), ¶m); + mappings->insert_location (crate_num, mapping.get_hirid (), + param.get_locus ()); + } } void visit (AST::TraitItemMethod &method) override @@ -446,6 +455,23 @@ public: mapping.get_hirid (), translated); mappings->insert_location (crate_num, mapping.get_hirid (), trait_item->get_locus ()); + + // insert mappings for self + mappings->insert_hir_self_param (crate_num, + self_param.get_mappings ().get_hirid (), + &self_param); + mappings->insert_location (crate_num, + self_param.get_mappings ().get_hirid (), + self_param.get_locus ()); + + // add the mappings for the function params at the end + for (auto ¶m : trait_item->get_decl ().get_function_params ()) + { + mappings->insert_hir_param (mapping.get_crate_num (), + param.get_mappings ().get_hirid (), ¶m); + mappings->insert_location (crate_num, mapping.get_hirid (), + param.get_locus ()); + } } void visit (AST::TraitItemConst &constant) override |