diff options
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r-- | gcc/rust/backend/rust-compile-fnparam.h | 10 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-var-decl.h | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-fnparam.h b/gcc/rust/backend/rust-compile-fnparam.h index 92a7357..a7bf52a 100644 --- a/gcc/rust/backend/rust-compile-fnparam.h +++ b/gcc/rust/backend/rust-compile-fnparam.h @@ -52,6 +52,16 @@ public: fndecl, pattern.get_identifier (), decl_type, address_taken, locus); } + void visit (HIR::WildcardPattern &pattern) override + { + decl_type = ctx->get_backend ()->immutable_type (decl_type); + + bool address_taken = false; + compiled_param + = ctx->get_backend ()->parameter_variable (fndecl, "_", decl_type, + address_taken, locus); + } + private: CompileFnParam (Context *ctx, tree fndecl, tree decl_type, Location locus, const HIR::FunctionParam ¶m) diff --git a/gcc/rust/backend/rust-compile-var-decl.h b/gcc/rust/backend/rust-compile-var-decl.h index a5c736d..4b52dcd 100644 --- a/gcc/rust/backend/rust-compile-var-decl.h +++ b/gcc/rust/backend/rust-compile-var-decl.h @@ -64,6 +64,15 @@ public: address_taken, locus); } + void visit (HIR::WildcardPattern &pattern) override + { + translated_type = ctx->get_backend ()->immutable_type (translated_type); + compiled_variable + = ctx->get_backend ()->local_variable (fndecl, "_", translated_type, + NULL /*decl_var*/, address_taken, + locus); + } + private: CompileVarDecl (Context *ctx, tree fndecl) : HIRCompileBase (ctx), fndecl (fndecl), |