about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-23 09:59:40 +0000
committerbors <bors@rust-lang.org>2023-10-23 09:59:40 +0000
commita56bd2b944aed6b4a0507cc1870fb4c86d08e48e (patch)
tree93fef0ff5217a7dc9b4c2d90affc5e1510c5427c /tests/ui/parser
parent6bb4ad6dfb7d373c2f19b6cc8c0f05bd73f6d3cc (diff)
parentfe8ebb1890574a713bc8ee7cd5cc6cde54989b55 (diff)
downloadrust-a56bd2b944aed6b4a0507cc1870fb4c86d08e48e.tar.gz
rust-a56bd2b944aed6b4a0507cc1870fb4c86d08e48e.zip
Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot
Avoid a `track_errors` by bubbling up most errors from `check_well_formed`

I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them.

This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`)

cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs6
-rw-r--r--tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr13
2 files changed, 7 insertions, 12 deletions
diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
index 9eeee195e56..f1238ec240f 100644
--- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
+++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
@@ -5,5 +5,9 @@ fn f2<'a>(x: u8, y: Vec<&'a ...>) {}
 //~^ ERROR C-variadic type `...` may not be nested inside another type
 
 fn main() {
-    let _recovery_witness: () = 0; //~ ERROR mismatched types
+    // 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;
 }
diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
index 8b9d676a45d..7ca6a6d1bbf 100644
--- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
+++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
@@ -10,15 +10,6 @@ error[E0743]: C-variadic type `...` may not be nested inside another type
 LL | fn f2<'a>(x: u8, y: Vec<&'a ...>) {}
    |                             ^^^
 
-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
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0308, E0743.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0743`.