about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-14 18:32:19 +0000
committerbors <bors@rust-lang.org>2024-02-14 18:32:19 +0000
commitee9c7c940c07d8b67c9a6b2ec930db70dcd23a46 (patch)
treed7a56ee060be2f76363bf3dfa5363b39f9882ec9 /tests/ui/parser
parent502ce8287bc3c86dca07acc38c5ff9431a6097be (diff)
parent25806f8d8052e5dc5f57830c31996769132fc4f8 (diff)
downloadrust-ee9c7c940c07d8b67c9a6b2ec930db70dcd23a46.tar.gz
rust-ee9c7c940c07d8b67c9a6b2ec930db70dcd23a46.zip
Auto merge of #120847 - oli-obk:track_errors9, r=compiler-errors
Continue compilation after check_mod_type_wf errors

The ICEs fixed here were probably reachable through const eval gymnastics before, but now they are easily reachable without that, too.

The new errors are often bugfixes, where useful errors were missing, because they were reported after the early abort. In other cases sometimes they are just duplication of already emitted errors, which won't be user-visible due to deduplication.

fixes https://github.com/rust-lang/rust/issues/120860
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs5
-rw-r--r--tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr13
2 files changed, 12 insertions, 6 deletions
diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
index f1238ec240f..4da9ad84bab 100644
--- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
+++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
@@ -5,9 +5,6 @@ fn f2<'a>(x: u8, y: Vec<&'a ...>) {}
 //~^ ERROR C-variadic type `...` may not be nested inside another type
 
 fn main() {
-    // While this is an error, wf-checks happen before typeck, and if any wf-checks
-    // encountered errors, we do not continue to typeck, even if the items are
-    // unrelated.
-    // FIXME(oli-obk): make this report a type mismatch again.
     let _recovery_witness: () = 0;
+    //~^ ERROR: mismatched types
 }
diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
index 7ca6a6d1bbf..8b9d676a45d 100644
--- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
+++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
@@ -10,6 +10,15 @@ error[E0743]: C-variadic type `...` may not be nested inside another type
 LL | fn f2<'a>(x: u8, y: Vec<&'a ...>) {}
    |                             ^^^
 
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+  --> $DIR/variadic-ffi-nested-syntactic-fail.rs:8:33
+   |
+LL |     let _recovery_witness: () = 0;
+   |                            --   ^ expected `()`, found integer
+   |                            |
+   |                            expected due to this
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0743`.
+Some errors have detailed explanations: E0308, E0743.
+For more information about an error, try `rustc --explain E0308`.