[gcc r17-2232] gccrs: remove useless diagnostic

Arthur Cohen via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:ea5b142c31e8154954b0c22200b03c20b3b3d6f5

commit r17-2232-gea5b142c31e8154954b0c22200b03c20b3b3d6f5
Author: Philip Herron <[email protected]>
Date:   Wed Jun 24 16:24:20 2026 +0100

    gccrs: remove useless diagnostic
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): remove error_at
    
    gcc/testsuite/ChangeLog:
    
            * rust/compile/issue-2479.rs: update test
    
    Signed-off-by: Philip Herron <[email protected]>

Diff:
---
 gcc/rust/typecheck/rust-hir-type-check-item.cc | 6 +-----
 gcc/testsuite/rust/compile/issue-2479.rs       | 1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.cc b/gcc/rust/typecheck/rust-hir-type-check-item.cc
index 1299e29b0f90..d8f2b8754e89 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-item.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-item.cc
@@ -723,11 +723,7 @@ TypeCheckItem::visit (HIR::Function &function)
     {
       auto resolved = TypeCheckType::Resolve (function.get_return_type ());
       if (resolved->get_kind () == TyTy::TypeKind::ERROR)
-	{
-	  rust_error_at (function.get_locus (),
-			 "failed to resolve return type");
-	  return;
-	}
+	return;
 
       ret_type = resolved->clone ();
       ret_type->set_ref (
diff --git a/gcc/testsuite/rust/compile/issue-2479.rs b/gcc/testsuite/rust/compile/issue-2479.rs
index 8536228ee979..b835a87d8715 100644
--- a/gcc/testsuite/rust/compile/issue-2479.rs
+++ b/gcc/testsuite/rust/compile/issue-2479.rs
@@ -9,7 +9,6 @@ enum Dragon {
 
 fn oblivion() -> Dragon::Born {
 // { dg-error "expected type, found variant of .Dragon::Born." "" { target *-*-* } .-1 }
-// { dg-error "failed to resolve return type" "" { target *-*-* } .-2 }
     Dragon::Born
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.