public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Traits do allow TypeParameters with defaults
@ 2022-06-08 11:50 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 11:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0f3fc1983d6e322b2f85b0c81b77fbfc0a1c280a

commit 0f3fc1983d6e322b2f85b0c81b77fbfc0a1c280a
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Tue Nov 16 13:26:01 2021 +0000

    Traits do allow TypeParameters with defaults
    
    Core traits such as the arithmetic operations have generic arguments such
    as: pub trait Add<Rhs = Self>
    
    Addresses #249

Diff:
---
 gcc/rust/hir/rust-ast-lower-item.h | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/gcc/rust/hir/rust-ast-lower-item.h b/gcc/rust/hir/rust-ast-lower-item.h
index db0425ff7df..65a49213986 100644
--- a/gcc/rust/hir/rust-ast-lower-item.h
+++ b/gcc/rust/hir/rust-ast-lower-item.h
@@ -613,29 +613,6 @@ public:
     if (trait.has_generics ())
       {
 	generic_params = lower_generic_params (trait.get_generic_params ());
-
-	for (auto &generic_param : generic_params)
-	  {
-	    switch (generic_param->get_kind ())
-	      {
-		case HIR::GenericParam::GenericKind::TYPE: {
-		  const HIR::TypeParam &t
-		    = static_cast<const HIR::TypeParam &> (*generic_param);
-
-		  if (t.has_type ())
-		    {
-		      // see https://github.com/rust-lang/rust/issues/36887
-		      rust_error_at (
-			t.get_locus (),
-			"defaults for type parameters are not allowed here");
-		    }
-		}
-		break;
-
-	      default:
-		break;
-	      }
-	  }
       }
 
     std::vector<std::unique_ptr<HIR::TypeParamBound>> type_param_bounds;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:50 [gcc/devel/rust/master] Traits do allow TypeParameters with defaults Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).