aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2024-12-25 11:07:17 +0000
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-21 12:55:43 +0100
commit36dfbd985e7060bafc78aca8b85f9d71dac503c3 (patch)
tree88000d0322ea56bb857325ab5c45fbe4e429739d /gcc/rust
parentc0640954e1a340764368a10f3b7774696e32a8ae (diff)
downloadgcc-36dfbd985e7060bafc78aca8b85f9d71dac503c3.zip
gcc-36dfbd985e7060bafc78aca8b85f9d71dac503c3.tar.gz
gcc-36dfbd985e7060bafc78aca8b85f9d71dac503c3.tar.bz2
gccrs: typecheck: Add note about erorring out on additional trait bounds.
If additional trait bounds aren't auto traits, then the typechecker must error out (Rust-GCC#3008) gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc: Add TODO note.
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-type.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc
index e9859a7..e9207ef 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-type.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc
@@ -757,6 +757,11 @@ TypeCheckType::visit (HIR::TraitObjectType &type)
std::vector<TyTy::TypeBoundPredicate> specified_bounds;
for (auto &bound : type.get_type_param_bounds ())
{
+ // TODO: here we need to check if there are additional bounds that aren't
+ // auto traits. this is an error. for example, `dyn A + Sized + Sync` is
+ // okay, because Sized and Sync are both auto traits but `dyn A + Copy +
+ // Clone` is not okay and should error out.
+
if (bound->get_bound_type ()
!= HIR::TypeParamBound::BoundType::TRAITBOUND)
continue;