]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Lower 'for' lifetimes
authorJakub Dupak <dev@jakubdupak.com>
Sun, 3 Dec 2023 11:32:55 +0000 (12:32 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:51 +0000 (12:36 +0100)
gcc/rust/ChangeLog:

* hir/rust-ast-lower-type.cc (ASTLoweringType::visit): For lifetimes.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
gcc/rust/hir/rust-ast-lower-type.cc

index 5cea71f83a23c7576ef278b34a4eb5f90beeb056..a0178ebf490ef38f9c7be5d232165c82dc3a38ae 100644 (file)
@@ -199,6 +199,13 @@ ASTLoweringType::visit (AST::BareFunctionType &fntype)
 {
   bool is_variadic = false;
   std::vector<HIR::LifetimeParam> lifetime_params;
+  for (auto &lifetime_param : fntype.get_for_lifetimes ())
+    {
+      auto generic_param = ASTLowerGenericParam::translate (&lifetime_param);
+      lifetime_params.push_back (
+       *static_cast<HIR::LifetimeParam *> (generic_param));
+    }
+
   HIR::FunctionQualifiers qualifiers
     = lower_qualifiers (fntype.get_function_qualifiers ());