aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-04-15 14:59:04 +0100
committerPhilip Herron <philip.herron@embecosm.com>2021-04-17 16:45:43 +0100
commit01486c14135646ea011dfa2c3a1dfbf59abbe436 (patch)
tree6f78ef05ebc4c7a4cd453c21043c33fb11d5e139
parented651fcdec170456f7460703edbd0ca5901f0026 (diff)
downloadgcc-01486c14135646ea011dfa2c3a1dfbf59abbe436.zip
gcc-01486c14135646ea011dfa2c3a1dfbf59abbe436.tar.gz
gcc-01486c14135646ea011dfa2c3a1dfbf59abbe436.tar.bz2
Remove fatal error
This fatal error stops the compiler in its tracks and will mean the Typed HIR dump will not occur limiting how much we can debug errors/bugs in the compiler. Fixes #327
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-expr.h6
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-stmt.h6
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/arrays1.rs1
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/arrays2.rs3
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/bad_type1.rs1
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/generics1.rs2
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/generics2.rs2
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/generics3.rs2
-rw-r--r--gcc/testsuite/rust.test/xfail_compile/tuple1.rs1
9 files changed, 6 insertions, 18 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h
index bdc6df3..6b6eed0 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h
@@ -290,11 +290,7 @@ public:
auto result = lhs->unify (rhs);
if (result->get_kind () == TyTy::TypeKind::ERROR)
- {
- rust_error_at (expr.get_locus (),
- "type resolution failure in AssignmentExpr");
- return;
- }
+ return;
// in the case of declare first for an ADT Type:
//
diff --git a/gcc/rust/typecheck/rust-hir-type-check-stmt.h b/gcc/rust/typecheck/rust-hir-type-check-stmt.h
index e52368a..e0e7adc 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-stmt.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-stmt.h
@@ -76,11 +76,7 @@ public:
{
auto unified_ty = specified_ty->unify (init_expr_ty);
if (unified_ty->get_kind () == TyTy::TypeKind::ERROR)
- {
- rust_fatal_error (stmt.get_locus (),
- "failure in setting up let stmt type");
- return;
- }
+ return;
context->insert_type (stmt.get_mappings (), unified_ty);
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/arrays1.rs b/gcc/testsuite/rust.test/xfail_compile/arrays1.rs
index ee844a6..714a6be 100644
--- a/gcc/testsuite/rust.test/xfail_compile/arrays1.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/arrays1.rs
@@ -1,5 +1,4 @@
fn main() {
let xs: [i32; 5] = [1, 2, 3, 4, 5];
let a: bool = xs[0]; // { dg-error "expected .bool. got .i32." }
- // { dg-error "failure in setting up let stmt type" "" { target { *-*-* } } .-1 }
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/arrays2.rs b/gcc/testsuite/rust.test/xfail_compile/arrays2.rs
index 69d362d..31ae1e2 100644
--- a/gcc/testsuite/rust.test/xfail_compile/arrays2.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/arrays2.rs
@@ -1,5 +1,4 @@
fn main() {
let array: [i32; 5] = [1, 2, 3]; // { dg-error "mismatch in array capacity" }
- // { dg-error "expected ..i32:5.. got ..i32:3.." "" { target { *-*-* } } .-1 }
- // { dg-error "failure in setting up let stmt type" "" { target { *-*-* } } .-2 }
+ // { dg-error "expected ..i32:5.. got ..i32:3.." "" { target { *-*-* } } .-1 }
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/bad_type1.rs b/gcc/testsuite/rust.test/xfail_compile/bad_type1.rs
index 336661e..93de439 100644
--- a/gcc/testsuite/rust.test/xfail_compile/bad_type1.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/bad_type1.rs
@@ -1,4 +1,3 @@
fn main() {
let logical: bool = 123; // { dg-error "expected .bool. got .<integer>." }
- // { dg-error "failure in setting up let stmt type" "" { target { *-*-* } } .-1 }
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/generics1.rs b/gcc/testsuite/rust.test/xfail_compile/generics1.rs
index 7f2493d..7042099 100644
--- a/gcc/testsuite/rust.test/xfail_compile/generics1.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/generics1.rs
@@ -6,6 +6,6 @@ fn main() {
let a2: GenericStruct<i8>;
a2 = GenericStruct::<_>(1, 456);
- let b2: i32 = a2.0; // { dg-error "failure in setting up let stmt type" }
+ let b2: i32 = a2.0;
let c2: usize = a2.1;
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/generics2.rs b/gcc/testsuite/rust.test/xfail_compile/generics2.rs
index d7a1b50..eb53c24 100644
--- a/gcc/testsuite/rust.test/xfail_compile/generics2.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/generics2.rs
@@ -6,6 +6,6 @@ fn main() {
let a2: GenericStruct<i8>;
a2 = GenericStruct(1, 456);
- let b2: i32 = a2.0; // { dg-error "failure in setting up let stmt type" }
+ let b2: i32 = a2.0;
let c2: usize = a2.1;
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/generics3.rs b/gcc/testsuite/rust.test/xfail_compile/generics3.rs
index 14bcc59..bc49a65 100644
--- a/gcc/testsuite/rust.test/xfail_compile/generics3.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/generics3.rs
@@ -5,6 +5,6 @@ fn main() {
let a2;
a2 = GenericStruct::<i8>(1, 456);
- let b2: i32 = a2.0; // { dg-error "failure in setting up let stmt type" }
+ let b2: i32 = a2.0;
let c2: usize = a2.1;
}
diff --git a/gcc/testsuite/rust.test/xfail_compile/tuple1.rs b/gcc/testsuite/rust.test/xfail_compile/tuple1.rs
index 67a33f4..84179b1 100644
--- a/gcc/testsuite/rust.test/xfail_compile/tuple1.rs
+++ b/gcc/testsuite/rust.test/xfail_compile/tuple1.rs
@@ -1,4 +1,3 @@
-// { dg-excess-errors "Noisy error and debug" }
fn main() {
let a: (i32, bool) = (123, 123); // { dg-error "expected .bool. got .<integer>." }
let b;