From: Philip Herron <[email protected]>
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]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/6f9aa791d1417e75e3bb321fc764970c1b44bd25
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/4607
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 1299e29b0..d8f2b8754 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 8536228ee..b835a87d8 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
}
base-commit: 1756c79853e5c399ed6704fc8a439d0951622e53
--
2.54.0