[gcc/devel/rust/master] gccrs: group basetype virtuals together and remove unused virtual

Thomas Schwinge tschwinge@gcc.gnu.org
Mon Mar 20 07:23:33 GMT 2023


https://gcc.gnu.org/g:bab564903706658ce8fa3704b656eeb1dce53330

commit bab564903706658ce8fa3704b656eeb1dce53330
Author: Philip Herron <herron.philip@googlemail.com>
Date:   Fri Mar 10 18:08:18 2023 +0000

    gccrs: group basetype virtuals together and remove unused virtual
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-tyty.h: cleanup ordering of header
    
    Signed-off-by: Philip Herron <herron.philip@googlemail.com>

Diff:
---
 gcc/rust/typecheck/rust-tyty.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index ce17c18fcab..dfc02a91126 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -131,10 +131,6 @@ public:
   // return the type-kind
   TypeKind get_kind () const;
 
-  /* Returns a pointer to a clone of this. The caller is responsible for
-   * releasing the memory of the returned ty. */
-  virtual BaseType *clone () const = 0;
-
   // monomorphized clone is a clone which destructures the types to get rid of
   // generics
   BaseType *monomorphized_clone () const;
@@ -144,13 +140,7 @@ public:
 
   void append_reference (HirId id);
 
-  virtual bool supports_substitutions () const;
-
-  virtual bool has_subsititions_defined () const;
-
-  virtual bool can_substitute () const;
-
-  virtual bool needs_generic_substitutions () const;
+  bool can_substitute () const;
 
   bool contains_type_parameters () const;
 
@@ -172,6 +162,16 @@ public:
 
   Location get_locus () const;
 
+  /* Returns a pointer to a clone of this. The caller is responsible for
+   * releasing the memory of the returned ty. */
+  virtual BaseType *clone () const = 0;
+
+  virtual bool supports_substitutions () const;
+
+  virtual bool has_subsititions_defined () const;
+
+  virtual bool needs_generic_substitutions () const;
+
 protected:
   BaseType (HirId ref, HirId ty_ref, TypeKind kind, RustIdent ident,
 	    std::set<HirId> refs = std::set<HirId> ());


More information about the Gcc-cvs mailing list