[committed 54/88] gccrs: Remove bad error message on checking function arguments

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Wed Apr 5 14:03:38 GMT 2023


From: Philip Herron <herron.philip@googlemail.com>

Signed-off-by: Philip Herron <herron.philip@googlemail.com>

gcc/rust/ChangeLog:

	* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove error message

gcc/testsuite/ChangeLog:

	* rust/compile/func3.rs: update test case
---
 gcc/rust/typecheck/rust-tyty-call.cc | 5 -----
 gcc/testsuite/rust/compile/func3.rs  | 1 -
 2 files changed, 6 deletions(-)

diff --git a/gcc/rust/typecheck/rust-tyty-call.cc b/gcc/rust/typecheck/rust-tyty-call.cc
index 4c6442e2d82..67e2866cbce 100644
--- a/gcc/rust/typecheck/rust-tyty-call.cc
+++ b/gcc/rust/typecheck/rust-tyty-call.cc
@@ -140,8 +140,6 @@ TypeCheckCallExpr::visit (FnType &type)
 	    argument->get_locus ());
 	  if (resolved_argument_type->get_kind () == TyTy::TypeKind::ERROR)
 	    {
-	      rust_error_at (argument->get_locus (),
-			     "Type Resolution failure on parameter");
 	      return;
 	    }
 	}
@@ -193,8 +191,6 @@ TypeCheckCallExpr::visit (FnPtr &type)
 	TyWithLocation (argument_expr_tyty, arg_locus), argument->get_locus ());
       if (resolved_argument_type->get_kind () == TyTy::TypeKind::ERROR)
 	{
-	  rust_error_at (argument->get_locus (),
-			 "Type Resolution failure on parameter");
 	  return;
 	}
 
@@ -301,7 +297,6 @@ TypeCheckMethodCallExpr::check (FnType &type)
 	TyWithLocation (argument_expr_tyty, arg_locus), arg_locus);
       if (resolved_argument_type->get_kind () == TyTy::TypeKind::ERROR)
 	{
-	  rust_error_at (arg_locus, "Type Resolution failure on parameter");
 	  return new ErrorType (type.get_ref ());
 	}
 
diff --git a/gcc/testsuite/rust/compile/func3.rs b/gcc/testsuite/rust/compile/func3.rs
index 2a329476118..002e5c90ab5 100644
--- a/gcc/testsuite/rust/compile/func3.rs
+++ b/gcc/testsuite/rust/compile/func3.rs
@@ -5,5 +5,4 @@ fn test(a: i32, b: i32) -> i32 {
 fn main() {
     let a = test(1, true);
     // { dg-error "expected .i32. got .bool." "" { target *-*-* } .-1 }
-    // { dg-error "Type Resolution failure on parameter" "" { target *-*-* } .-2 }
 }
-- 
2.40.0



More information about the Gcc-rust mailing list