[committed,45/88] gccrs: Rename header rust-hir-trait-ref.h to rust-hir-trait-reference.h

Message ID 20230405140411.3016563-46-arthur.cohen@embecosm.com
State Accepted
Headers
Series [committed,01/88] gccrs: fatal_error_flag: Fix typo in error message |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Arthur Cohen April 5, 2023, 2:03 p.m. UTC
  From: Philip Herron <herron.philip@googlemail.com>

Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/rust/ChangeLog:

	* typecheck/rust-hir-trait-ref.h: Moved to...
	* typecheck/rust-hir-trait-reference.h: ...here.
	* typecheck/rust-hir-trait-resolve.cc: refactor
	* typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRAIT_RESOLVE_H): likewise
	* typecheck/rust-hir-type-check.h: likewise
	* typecheck/rust-tyty.cc: likewise
---
 ...rust-hir-trait-ref.h => rust-hir-trait-reference.h} |  0
 gcc/rust/typecheck/rust-hir-trait-resolve.cc           | 10 ++++++++++
 gcc/rust/typecheck/rust-hir-trait-resolve.h            |  9 +--------
 gcc/rust/typecheck/rust-hir-type-check.h               |  2 +-
 gcc/rust/typecheck/rust-tyty.cc                        |  2 +-
 5 files changed, 13 insertions(+), 10 deletions(-)
 rename gcc/rust/typecheck/{rust-hir-trait-ref.h => rust-hir-trait-reference.h} (100%)
  

Patch

diff --git a/gcc/rust/typecheck/rust-hir-trait-ref.h b/gcc/rust/typecheck/rust-hir-trait-reference.h
similarity index 100%
rename from gcc/rust/typecheck/rust-hir-trait-ref.h
rename to gcc/rust/typecheck/rust-hir-trait-reference.h
diff --git a/gcc/rust/typecheck/rust-hir-trait-resolve.cc b/gcc/rust/typecheck/rust-hir-trait-resolve.cc
index 19f95ca4488..e2d0cf2d7a2 100644
--- a/gcc/rust/typecheck/rust-hir-trait-resolve.cc
+++ b/gcc/rust/typecheck/rust-hir-trait-resolve.cc
@@ -22,6 +22,16 @@ 
 namespace Rust {
 namespace Resolver {
 
+TraitItemReference
+ResolveTraitItemToRef::Resolve (
+  HIR::TraitItem &item, TyTy::BaseType *self,
+  std::vector<TyTy::SubstitutionParamMapping> substitutions)
+{
+  ResolveTraitItemToRef resolver (self, std::move (substitutions));
+  item.accept_vis (resolver);
+  return std::move (resolver.resolved);
+}
+
 void
 ResolveTraitItemToRef::visit (HIR::TraitItemType &type)
 {
diff --git a/gcc/rust/typecheck/rust-hir-trait-resolve.h b/gcc/rust/typecheck/rust-hir-trait-resolve.h
index ca23d48c3dd..da8e2c0b838 100644
--- a/gcc/rust/typecheck/rust-hir-trait-resolve.h
+++ b/gcc/rust/typecheck/rust-hir-trait-resolve.h
@@ -19,9 +19,7 @@ 
 #ifndef RUST_HIR_TRAIT_RESOLVE_H
 #define RUST_HIR_TRAIT_RESOLVE_H
 
-#include "rust-hir-type-check-base.h"
 #include "rust-hir-type-check-type.h"
-#include "rust-hir-trait-ref.h"
 
 namespace Rust {
 namespace Resolver {
@@ -32,12 +30,7 @@  class ResolveTraitItemToRef : public TypeCheckBase,
 public:
   static TraitItemReference
   Resolve (HIR::TraitItem &item, TyTy::BaseType *self,
-	   std::vector<TyTy::SubstitutionParamMapping> substitutions)
-  {
-    ResolveTraitItemToRef resolver (self, std::move (substitutions));
-    item.accept_vis (resolver);
-    return std::move (resolver.resolved);
-  }
+	   std::vector<TyTy::SubstitutionParamMapping> substitutions);
 
   void visit (HIR::TraitItemType &type) override;
 
diff --git a/gcc/rust/typecheck/rust-hir-type-check.h b/gcc/rust/typecheck/rust-hir-type-check.h
index d1eb750a621..512453947a6 100644
--- a/gcc/rust/typecheck/rust-hir-type-check.h
+++ b/gcc/rust/typecheck/rust-hir-type-check.h
@@ -22,7 +22,7 @@ 
 #include "rust-hir-full-decls.h"
 #include "rust-hir-map.h"
 #include "rust-tyty.h"
-#include "rust-hir-trait-ref.h"
+#include "rust-hir-trait-reference.h"
 #include "rust-autoderef.h"
 
 namespace Rust {
diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index 61c02a85c53..4c324c66c16 100644
--- a/gcc/rust/typecheck/rust-tyty.cc
+++ b/gcc/rust/typecheck/rust-tyty.cc
@@ -27,7 +27,7 @@ 
 #include "rust-linemap.h"
 
 #include "rust-substitution-mapper.h"
-#include "rust-hir-trait-ref.h"
+#include "rust-hir-trait-reference.h"
 #include "rust-hir-type-bounds.h"
 #include "rust-hir-trait-resolve.h"
 #include "rust-tyty-rules.h"