From 1e1bcabf1c6aabb5b5eb5abf6689b88313dbb736 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Fri, 3 Mar 2023 18:17:50 +0000 Subject: gccrs: make predicate bounds overwrite-able When compiling types especially when using queries it needs to be permissive and allow them to be overwritten and a predicate might have one set of details in one senario and a new one with the same id later on but with different types. Fixes #1524 Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-typecheck-context.cc (TypeCheckContext::insert_resolved_predicate): remove gcc/testsuite/ChangeLog: * rust/compile/issue-1524.rs: New test. --- gcc/rust/typecheck/rust-typecheck-context.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/rust') diff --git a/gcc/rust/typecheck/rust-typecheck-context.cc b/gcc/rust/typecheck/rust-typecheck-context.cc index 04135e7..093bc0a 100644 --- a/gcc/rust/typecheck/rust-typecheck-context.cc +++ b/gcc/rust/typecheck/rust-typecheck-context.cc @@ -437,8 +437,8 @@ void TypeCheckContext::insert_resolved_predicate (HirId id, TyTy::TypeBoundPredicate predicate) { - auto it = predicates.find (id); - rust_assert (it == predicates.end ()); + // auto it = predicates.find (id); + // rust_assert (it == predicates.end ()); predicates.insert ({id, predicate}); } -- cgit v1.1