diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-11-16 13:26:01 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-11-16 14:04:56 +0000 |
commit | 0f3fc1983d6e322b2f85b0c81b77fbfc0a1c280a (patch) | |
tree | 87cbf09d3bc7fd607bc1908f783f05f9d12eb9ec /gcc/rust | |
parent | fdd69a69f870bbb01a141cef0776169f3acd7663 (diff) | |
download | gcc-0f3fc1983d6e322b2f85b0c81b77fbfc0a1c280a.zip gcc-0f3fc1983d6e322b2f85b0c81b77fbfc0a1c280a.tar.gz gcc-0f3fc1983d6e322b2f85b0c81b77fbfc0a1c280a.tar.bz2 |
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
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-item.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-item.h b/gcc/rust/hir/rust-ast-lower-item.h index db0425f..65a4921 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; |