]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Move TypePredicateItem impl out of the header
authorPhilip Herron <herron.philip@googlemail.com>
Thu, 12 Jan 2023 16:40:30 +0000 (16:40 +0000)
committerPhilip Herron <herron.philip@googlemail.com>
Sun, 5 Feb 2023 00:06:43 +0000 (00:06 +0000)
This moves the implementation code out of the header and into its
respective cc file.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

* typecheck/rust-tyty-bounds.cc (TypeBoundPredicateItem::error): refactor
(TypeBoundPredicateItem::is_error): likewise
(TypeBoundPredicateItem::get_parent): likewise
* typecheck/rust-tyty.h: Move the implementation for the above

gcc/rust/typecheck/rust-tyty-bounds.cc
gcc/rust/typecheck/rust-tyty.h

index e5057c8e3c0cfd73d160d47676360c5605429f4c..a307dd34c38ba777a2eab18dc4c2e4030d6d8363 100644 (file)
@@ -364,6 +364,30 @@ TypeBoundPredicate::lookup_associated_item (const std::string &search) const
   return TypeBoundPredicateItem (this, trait_item_ref);
 }
 
+TypeBoundPredicateItem::TypeBoundPredicateItem (
+  const TypeBoundPredicate *parent,
+  const Resolver::TraitItemReference *trait_item_ref)
+  : parent (parent), trait_item_ref (trait_item_ref)
+{}
+
+TypeBoundPredicateItem
+TypeBoundPredicateItem::error ()
+{
+  return TypeBoundPredicateItem (nullptr, nullptr);
+}
+
+bool
+TypeBoundPredicateItem::is_error () const
+{
+  return parent == nullptr || trait_item_ref == nullptr;
+}
+
+const TypeBoundPredicate *
+TypeBoundPredicateItem::get_parent () const
+{
+  return parent;
+}
+
 TypeBoundPredicateItem
 TypeBoundPredicate::lookup_associated_item (
   const Resolver::TraitItemReference *ref) const
index 4f333a8ed2f73bd1075d5f120b4ef65629703b6d..365bf7d1b3d43a19d06db512ca2bca902a3152e6 100644 (file)
@@ -82,19 +82,11 @@ class TypeBoundPredicateItem
 {
 public:
   TypeBoundPredicateItem (const TypeBoundPredicate *parent,
-                         const Resolver::TraitItemReference *trait_item_ref)
-    : parent (parent), trait_item_ref (trait_item_ref)
-  {}
+                         const Resolver::TraitItemReference *trait_item_ref);
 
-  static TypeBoundPredicateItem error ()
-  {
-    return TypeBoundPredicateItem (nullptr, nullptr);
-  }
+  static TypeBoundPredicateItem error ();
 
-  bool is_error () const
-  {
-    return parent == nullptr || trait_item_ref == nullptr;
-  }
+  bool is_error () const;
 
   BaseType *get_tyty_for_receiver (const TyTy::BaseType *receiver);
 
@@ -102,7 +94,7 @@ public:
 
   bool needs_implementation () const;
 
-  const TypeBoundPredicate *get_parent () const { return parent; }
+  const TypeBoundPredicate *get_parent () const;
 
   Location get_locus () const;