aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/rust-ast-lower-item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-item.cc')
-rw-r--r--gcc/rust/hir/rust-ast-lower-item.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-item.cc b/gcc/rust/hir/rust-ast-lower-item.cc
index 171737a..ae938d9 100644
--- a/gcc/rust/hir/rust-ast-lower-item.cc
+++ b/gcc/rust/hir/rust-ast-lower-item.cc
@@ -572,6 +572,12 @@ ASTLoweringItem::visit (AST::Trait &trait)
generic_params = lower_generic_params (trait.get_generic_params ());
}
+ // TODO: separate "Self" from normal generic parameters
+ // in HIR as well as in AST?
+ HIR::GenericParam *self_param
+ = ASTLowerGenericParam::translate (trait.get_implicit_self ());
+ generic_params.emplace (generic_params.begin (), self_param);
+
std::vector<std::unique_ptr<HIR::TypeParamBound>> type_param_bounds;
if (trait.has_type_param_bounds ())
{