]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: hir: Rename get_pattern_mappings method
authorJakub Dupak <dev@jakubdupak.com>
Tue, 17 Oct 2023 14:02:32 +0000 (16:02 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:23 +0000 (19:09 +0100)
Unify with the name used in Expr to allow convenient template over
everything that has mappings.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc: Rename method.
* backend/rust-compile-expr.cc (sort_tuple_patterns): Rename method.
* backend/rust-compile-pattern.cc (CompilePatternCaseLabelExpr::visit): Rename method.
(CompilePatternBindings::visit): Rename method.
(CompilePatternLet::visit): Rename method.
* backend/rust-compile-stmt.cc (CompileStmt::visit): Rename method.
* backend/rust-compile-var-decl.h: Rename method.
* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate): Rename method.
* hir/rust-hir-dump.cc (Dump::visit): Rename method.
* hir/tree/rust-hir-path.h: Rename method.
* hir/tree/rust-hir-pattern.h: Rename method.
* hir/tree/rust-hir.h: Rename method.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::Resolve): Rename method.
(TypeCheckPattern::visit): Rename method.
(ClosureParamInfer::visit): Rename method.
* typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Rename method.
* util/rust-hir-map.cc (Mappings::insert_hir_pattern): Rename method.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
13 files changed:
gcc/rust/backend/rust-compile-base.cc
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/backend/rust-compile-pattern.cc
gcc/rust/backend/rust-compile-stmt.cc
gcc/rust/backend/rust-compile-var-decl.h
gcc/rust/hir/rust-ast-lower-pattern.cc
gcc/rust/hir/rust-hir-dump.cc
gcc/rust/hir/tree/rust-hir-path.h
gcc/rust/hir/tree/rust-hir-pattern.h
gcc/rust/hir/tree/rust-hir.h
gcc/rust/typecheck/rust-hir-type-check-pattern.cc
gcc/rust/typecheck/rust-hir-type-check-stmt.cc
gcc/rust/util/rust-hir-map.cc

index bfa09c8e9942a34f741c0d90594b8e8110d2897f..1c1c5e90afa7e69a5514df568bdd812147f09f80 100644 (file)
@@ -615,7 +615,7 @@ HIRCompileBase::compile_function (
       param_vars.push_back (compiled_param_var);
 
       const HIR::Pattern &param_pattern = *referenced_param.get_param_name ();
-      ctx->insert_var_decl (param_pattern.get_pattern_mappings ().get_hirid (),
+      ctx->insert_var_decl (param_pattern.get_mappings ().get_hirid (),
                            compiled_param_var);
     }
 
index 8e64e572bf2eeaaa10689cd6790edb044fbc63c3..b61b46aa6d74f76d8e4a1b0c905abe4b57649d57 100644 (file)
@@ -1072,7 +1072,7 @@ sort_tuple_patterns (HIR::MatchExpr &expr)
 
              // Construct a TuplePattern from the rest of the patterns
              result_pattern = std::unique_ptr<HIR::Pattern> (
-               new HIR::TuplePattern (ref.get_pattern_mappings (),
+               new HIR::TuplePattern (ref.get_mappings (),
                                       std::move (new_items),
                                       ref.get_locus ()));
            }
index 53de49558b8d19f266312a95d1de1c40942d2862..93a5f7cd5e406149326fe303728925d815b7da2c 100644 (file)
@@ -85,8 +85,8 @@ CompilePatternCaseLabelExpr::visit (HIR::LiteralPattern &pattern)
 {
   // Compile the literal
   HIR::LiteralExpr *litexpr
-    = new HIR::LiteralExpr (pattern.get_pattern_mappings (),
-                           pattern.get_literal (), pattern.get_locus (),
+    = new HIR::LiteralExpr (pattern.get_mappings (), pattern.get_literal (),
+                           pattern.get_locus (),
                            std::vector<AST::Attribute> ());
 
   // Note: Floating point literals are currently accepted but will likely be
@@ -164,10 +164,10 @@ void
 CompilePatternCaseLabelExpr::visit (HIR::RangePattern &pattern)
 {
   tree upper = compile_range_pattern_bound (pattern.get_upper_bound ().get (),
-                                           pattern.get_pattern_mappings (),
+                                           pattern.get_mappings (),
                                            pattern.get_locus (), ctx);
   tree lower = compile_range_pattern_bound (pattern.get_lower_bound ().get (),
-                                           pattern.get_pattern_mappings (),
+                                           pattern.get_mappings (),
                                            pattern.get_locus (), ctx);
 
   case_label_expr = build_case_label (lower, upper, associated_case_label);
@@ -239,7 +239,7 @@ CompilePatternBindings::visit (HIR::TupleStructPattern &pattern)
                                                      pattern->get_locus ());
 
                ctx->insert_pattern_binding (
-                 pattern->get_pattern_mappings ().get_hirid (), binding);
+                 pattern->get_mappings ().get_hirid (), binding);
              }
          }
        else
@@ -255,7 +255,7 @@ CompilePatternBindings::visit (HIR::TupleStructPattern &pattern)
                                                      pattern->get_locus ());
 
                ctx->insert_pattern_binding (
-                 pattern->get_pattern_mappings ().get_hirid (), binding);
+                 pattern->get_mappings ().get_hirid (), binding);
              }
          }
       }
@@ -362,7 +362,7 @@ CompilePatternBindings::visit (HIR::ReferencePattern &pattern)
 void
 CompilePatternBindings::visit (HIR::IdentifierPattern &pattern)
 {
-  ctx->insert_pattern_binding (pattern.get_pattern_mappings ().get_hirid (),
+  ctx->insert_pattern_binding (pattern.get_mappings ().get_hirid (),
                               match_scrutinee_expr);
 }
 
@@ -371,7 +371,7 @@ CompilePatternLet::visit (HIR::IdentifierPattern &pattern)
 {
   Bvariable *var = nullptr;
   rust_assert (
-    ctx->lookup_var_decl (pattern.get_pattern_mappings ().get_hirid (), &var));
+    ctx->lookup_var_decl (pattern.get_mappings ().get_hirid (), &var));
 
   auto fnctx = ctx->peek_fn ();
   if (ty->is_unit ())
@@ -429,7 +429,7 @@ CompilePatternLet::visit (HIR::TuplePattern &pattern)
        for (auto &sub : items_lower)
          {
            TyTy::BaseType *ty_sub = nullptr;
-           HirId pattern_id = pattern.get_pattern_mappings ().get_hirid ();
+           HirId pattern_id = pattern.get_mappings ().get_hirid ();
            bool ok = ctx->get_tyctx ()->lookup_type (pattern_id, &ty_sub);
            rust_assert (ok);
 
@@ -448,7 +448,7 @@ CompilePatternLet::visit (HIR::TuplePattern &pattern)
        for (auto &sub : items_upper)
          {
            TyTy::BaseType *ty_sub = nullptr;
-           HirId pattern_id = pattern.get_pattern_mappings ().get_hirid ();
+           HirId pattern_id = pattern.get_mappings ().get_hirid ();
            bool ok = ctx->get_tyctx ()->lookup_type (pattern_id, &ty_sub);
            rust_assert (ok);
 
@@ -470,7 +470,7 @@ CompilePatternLet::visit (HIR::TuplePattern &pattern)
        for (auto &sub : items.get_patterns ())
          {
            TyTy::BaseType *ty_sub = nullptr;
-           HirId pattern_id = pattern.get_pattern_mappings ().get_hirid ();
+           HirId pattern_id = pattern.get_mappings ().get_hirid ();
            bool ok = ctx->get_tyctx ()->lookup_type (pattern_id, &ty_sub);
            rust_assert (ok);
 
index 2d9578dac029c31ace84f1aa220359ae440b21ca..c006f4ace62899094114740c2f64b956732015ec 100644 (file)
@@ -49,7 +49,7 @@ CompileStmt::visit (HIR::LetStmt &stmt)
     return;
 
   HIR::Pattern &stmt_pattern = *stmt.get_pattern ();
-  HirId stmt_id = stmt_pattern.get_pattern_mappings ().get_hirid ();
+  HirId stmt_id = stmt_pattern.get_mappings ().get_hirid ();
 
   TyTy::BaseType *ty = nullptr;
   if (!ctx->get_tyctx ()->lookup_type (stmt_id, &ty))
index 3abff897b2eafa1f149a7237321877a35d883cee..370e939cd0ce02ee2e5c1678da30b899b4df9627 100644 (file)
@@ -47,7 +47,7 @@ public:
                                 translated_type, NULL /*decl_var*/,
                                 pattern.get_locus ());
 
-    HirId stmt_id = pattern.get_pattern_mappings ().get_hirid ();
+    HirId stmt_id = pattern.get_mappings ().get_hirid ();
     ctx->insert_var_decl (stmt_id, var);
 
     locals.push_back (var);
index 4693e7da04b1f263d9e0dcec6955a57f37afb240..a2228488ad2a2088b4023a68b0aec2d74c2630f2 100644 (file)
@@ -35,8 +35,7 @@ ASTLoweringPattern::translate (AST::Pattern *pattern, bool is_let_top_level)
 
   resolver.mappings->insert_hir_pattern (resolver.translated);
   resolver.mappings->insert_location (
-    resolver.translated->get_pattern_mappings ().get_hirid (),
-    pattern->get_locus ());
+    resolver.translated->get_mappings ().get_hirid (), pattern->get_locus ());
 
   return resolver.translated;
 }
index 15f4763417d9cca0ec517d2b3c68aa75e16373d9..45729b946447121db9878d87d7fecf6aed38013f 100644 (file)
@@ -2019,7 +2019,7 @@ Dump::visit (LiteralPattern &e)
 {
   begin ("LiteralPattern");
   put_field ("lit", e.get_literal ().as_string ());
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   end ("LiteralPattern");
 }
 
@@ -2042,7 +2042,7 @@ void
 Dump::visit (WildcardPattern &e)
 {
   begin ("WildcardPattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   end ("WildcardPattern");
 }
 
@@ -2075,7 +2075,7 @@ void
 Dump::visit (RangePattern &e)
 {
   begin ("RangePattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   put_field ("lower", e.get_lower_bound ()->as_string ());
   put_field ("upper", e.get_upper_bound ()->as_string ());
   put_field ("has_ellipsis_syntax",
@@ -2087,7 +2087,7 @@ void
 Dump::visit (ReferencePattern &e)
 {
   begin ("ReferencePattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   put_field ("mut", std::to_string (e.is_mut ()));
   put_field ("pattern", e.get_referenced_pattern ()->as_string ());
   end ("ReferencePattern");
@@ -2161,7 +2161,7 @@ void
 Dump::visit (TupleStructPattern &e)
 {
   begin ("TupleStructPattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
 
   put_field ("path", e.get_path ().as_string ());
 
@@ -2191,7 +2191,7 @@ void
 Dump::visit (TuplePattern &e)
 {
   begin ("TuplePattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   visit_field ("items", e.get_items ());
   end ("TuplePattern");
 }
@@ -2200,7 +2200,7 @@ void
 Dump::visit (SlicePattern &e)
 {
   begin ("SlicePattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   visit_collection ("items", e.get_items ());
   end ("SlicePattern");
 }
@@ -2209,7 +2209,7 @@ void
 Dump::visit (AltPattern &e)
 {
   begin ("AltPattern");
-  do_mappings (e.get_pattern_mappings ());
+  do_mappings (e.get_mappings ());
   visit_collection ("alts", e.get_alts ());
   end ("AltPattern");
 }
index 48b96ef261463408eaa4520f8f23716eb0765b20..33fbd8d9177d5c4d3f32ef4f0fa4c59f920f0f1b 100644 (file)
@@ -390,9 +390,9 @@ public:
           == 0;
   }
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
-    return get_mappings ();
+    return mappings;
   }
 
 protected:
@@ -864,9 +864,9 @@ public:
 
   location_t get_locus () { return locus; }
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
-    return get_mappings ();
+    return mappings;
   }
 
 protected:
index 1bd21a2074b14fc15ba6c6e044d44f975a47e58c..a76a0a40d5fb4449a069a2fdddbc0a1ed407be8a 100644 (file)
@@ -51,7 +51,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -137,7 +137,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -176,7 +176,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -395,7 +395,7 @@ public:
 
   bool get_has_ellipsis_syntax () { return has_ellipsis_syntax; };
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -464,7 +464,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -758,7 +758,7 @@ public:
   PathInExpression &get_path () { return path; }
   StructPatternElements &get_struct_pattern_elems () { return elems; }
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -991,7 +991,7 @@ public:
 
   std::unique_ptr<TupleStructItems> &get_items () { return items; }
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -1218,7 +1218,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -1293,7 +1293,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
@@ -1365,7 +1365,7 @@ public:
   void accept_vis (HIRFullVisitor &vis) override;
   void accept_vis (HIRPatternVisitor &vis) override;
 
-  const Analysis::NodeMapping &get_pattern_mappings () const override final
+  const Analysis::NodeMapping &get_mappings () const override final
   {
     return mappings;
   }
index a5143a763f717d458303d76859600675ac939b06..0f2d52256d2fd2910a96e588e672d5daa9b346df 100644 (file)
@@ -420,7 +420,7 @@ public:
 
   virtual void accept_vis (HIRPatternVisitor &vis) = 0;
 
-  virtual const Analysis::NodeMapping &get_pattern_mappings () const = 0;
+  virtual const Analysis::NodeMapping &get_mappings () const = 0;
 
   virtual location_t get_locus () const = 0;
 
index 4c001453a54f5553b9201f682f8168a54b9d5297..9d55f53425fdc92e34fdad60ec80823a8175a843 100644 (file)
@@ -34,10 +34,9 @@ TypeCheckPattern::Resolve (HIR::Pattern *pattern, TyTy::BaseType *parent)
   pattern->accept_vis (resolver);
 
   if (resolver.infered == nullptr)
-    return new TyTy::ErrorType (pattern->get_pattern_mappings ().get_hirid ());
+    return new TyTy::ErrorType (pattern->get_mappings ().get_hirid ());
 
-  resolver.context->insert_type (pattern->get_pattern_mappings (),
-                                resolver.infered);
+  resolver.context->insert_type (pattern->get_mappings (), resolver.infered);
   return resolver.infered;
 }
 
@@ -135,7 +134,7 @@ TypeCheckPattern::visit (HIR::TupleStructPattern &pattern)
            TyTy::BaseType *fty = field->get_field_type ();
 
            // setup the type on this pattern type
-           context->insert_type (pattern->get_pattern_mappings (), fty);
+           context->insert_type (pattern->get_mappings (), fty);
          }
       }
       break;
@@ -289,7 +288,7 @@ TypeCheckPattern::visit (HIR::WildcardPattern &pattern)
   // wildcard patterns within the MatchArm's are simply just the same type as
   // the parent
   infered = parent->clone ();
-  infered->set_ref (pattern.get_pattern_mappings ().get_hirid ());
+  infered->set_ref (pattern.get_mappings ().get_hirid ());
 }
 
 void
@@ -332,9 +331,8 @@ TypeCheckPattern::visit (HIR::TuplePattern &pattern)
              = TypeCheckPattern::Resolve (p.get (), par_type);
            pattern_elems.push_back (TyTy::TyVar (elem->get_ref ()));
          }
-       infered
-         = new TyTy::TupleType (pattern.get_pattern_mappings ().get_hirid (),
-                                pattern.get_locus (), pattern_elems);
+       infered = new TyTy::TupleType (pattern.get_mappings ().get_hirid (),
+                                      pattern.get_locus (), pattern_elems);
       }
       break;
 
@@ -352,8 +350,8 @@ TypeCheckPattern::visit (HIR::TuplePattern &pattern)
 void
 TypeCheckPattern::visit (HIR::LiteralPattern &pattern)
 {
-  infered = resolve_literal (pattern.get_pattern_mappings (),
-                            pattern.get_literal (), pattern.get_locus ());
+  infered = resolve_literal (pattern.get_mappings (), pattern.get_literal (),
+                            pattern.get_locus ());
 }
 
 void
@@ -363,14 +361,14 @@ TypeCheckPattern::visit (HIR::RangePattern &pattern)
   TyTy::BaseType *upper = nullptr, *lower = nullptr;
 
   upper = typecheck_range_pattern_bound (pattern.get_upper_bound (),
-                                        pattern.get_pattern_mappings (),
+                                        pattern.get_mappings (),
                                         pattern.get_locus ());
 
   lower = typecheck_range_pattern_bound (pattern.get_lower_bound (),
-                                        pattern.get_pattern_mappings (),
+                                        pattern.get_mappings (),
                                         pattern.get_locus ());
 
-  infered = unify_site (pattern.get_pattern_mappings ().get_hirid (),
+  infered = unify_site (pattern.get_mappings ().get_hirid (),
                        TyTy::TyWithLocation (upper),
                        TyTy::TyWithLocation (lower), pattern.get_locus ());
 }
@@ -402,11 +400,10 @@ TypeCheckPattern::visit (HIR::ReferencePattern &pattern)
   TyTy::BaseType *infered_base
     = TypeCheckPattern::Resolve (pattern.get_referenced_pattern ().get (),
                                 ref_ty_ty->get_base ());
-  infered
-    = new TyTy::ReferenceType (pattern.get_pattern_mappings ().get_hirid (),
-                              TyTy::TyVar (infered_base->get_ref ()),
-                              pattern.is_mut () ? Mutability::Mut
-                                                : Mutability::Imm);
+  infered = new TyTy::ReferenceType (pattern.get_mappings ().get_hirid (),
+                                    TyTy::TyVar (infered_base->get_ref ()),
+                                    pattern.is_mut () ? Mutability::Mut
+                                                      : Mutability::Imm);
 }
 
 void
@@ -488,7 +485,7 @@ TypeCheckPattern::visit (HIR::AltPattern &pattern)
   for (auto &type : types)
     {
       alt_pattern_type
-       = unify_site (pattern.get_pattern_mappings ().get_hirid (),
+       = unify_site (pattern.get_mappings ().get_hirid (),
                      TyTy::TyWithLocation (alt_pattern_type),
                      TyTy::TyWithLocation (type, type->get_locus ()),
                      pattern.get_locus ());
@@ -519,7 +516,7 @@ ClosureParamInfer::ClosureParamInfer ()
 void
 ClosureParamInfer::visit (HIR::WildcardPattern &pattern)
 {
-  HirId id = pattern.get_pattern_mappings ().get_hirid ();
+  HirId id = pattern.get_mappings ().get_hirid ();
   infered = new TyTy::InferType (id, TyTy::InferType::InferTypeKind::GENERAL,
                                 TyTy::InferType::TypeHint::Default (),
                                 pattern.get_locus ());
@@ -528,7 +525,7 @@ ClosureParamInfer::visit (HIR::WildcardPattern &pattern)
 void
 ClosureParamInfer::visit (HIR::IdentifierPattern &pattern)
 {
-  HirId id = pattern.get_pattern_mappings ().get_hirid ();
+  HirId id = pattern.get_mappings ().get_hirid ();
   infered = new TyTy::InferType (id, TyTy::InferType::InferTypeKind::GENERAL,
                                 TyTy::InferType::TypeHint::Default (),
                                 pattern.get_locus ());
@@ -540,7 +537,7 @@ ClosureParamInfer::visit (HIR::ReferencePattern &pattern)
   TyTy::BaseType *element
     = ClosureParamInfer::Resolve (pattern.get_referenced_pattern ().get ());
 
-  HirId id = pattern.get_pattern_mappings ().get_hirid ();
+  HirId id = pattern.get_mappings ().get_hirid ();
   infered = new TyTy::ReferenceType (id, TyTy::TyVar (element->get_ref ()),
                                     pattern.get_mutability ());
 }
index 99eb41d6e0cd483ccbee8b5142a74e5e4367c291..16925c9f7e09f46aedf9c0e6d58e58f989ded013 100644 (file)
@@ -87,7 +87,7 @@ TypeCheckStmt::visit (HIR::LetStmt &stmt)
        return;
 
       init_expr_ty->append_reference (
-       stmt_pattern.get_pattern_mappings ().get_hirid ());
+       stmt_pattern.get_mappings ().get_hirid ());
     }
 
   TyTy::BaseType *specified_ty = nullptr;
@@ -122,10 +122,11 @@ TypeCheckStmt::visit (HIR::LetStmt &stmt)
       // let x;
       else
        {
-         auto infer = new TyTy::InferType (
-           stmt_pattern.get_pattern_mappings ().get_hirid (),
-           TyTy::InferType::InferTypeKind::GENERAL,
-           TyTy::InferType::TypeHint::Default (), stmt.get_locus ());
+         auto infer
+           = new TyTy::InferType (stmt_pattern.get_mappings ().get_hirid (),
+                                  TyTy::InferType::InferTypeKind::GENERAL,
+                                  TyTy::InferType::TypeHint::Default (),
+                                  stmt.get_locus ());
          TypeCheckPattern::Resolve (&stmt_pattern, infer);
        }
     }
index 1f4dd78de76b775478a4b01d1c15f3ea8c75b739..91fa2562c39bb10f11e46183aab1ccabb2cf6780 100644 (file)
@@ -709,11 +709,11 @@ Mappings::lookup_hir_struct_field (HirId id)
 void
 Mappings::insert_hir_pattern (HIR::Pattern *pattern)
 {
-  auto id = pattern->get_pattern_mappings ().get_hirid ();
+  auto id = pattern->get_mappings ().get_hirid ();
   rust_assert (lookup_hir_pattern (id) == nullptr);
 
   hirPatternMappings[id] = pattern;
-  insert_node_to_hir (pattern->get_pattern_mappings ().get_nodeid (), id);
+  insert_node_to_hir (pattern->get_mappings ().get_nodeid (), id);
 }
 
 HIR::Pattern *