about summary refs log tree commit diff
path: root/tests/ui/inference
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/inference
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/inference')
-rw-r--r--tests/ui/inference/issue-107090.rs2
-rw-r--r--tests/ui/inference/issue-107090.stderr17
2 files changed, 16 insertions, 3 deletions
diff --git a/tests/ui/inference/issue-107090.rs b/tests/ui/inference/issue-107090.rs
index 799c3641833..d1c86fb03d7 100644
--- a/tests/ui/inference/issue-107090.rs
+++ b/tests/ui/inference/issue-107090.rs
@@ -19,7 +19,7 @@ impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> {
 
 fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
     //~^ ERROR use of undeclared lifetime name
-    sadness.cast()
+    sadness.cast() //~ ERROR: mismatched types
 }
 
 fn main() {}
diff --git a/tests/ui/inference/issue-107090.stderr b/tests/ui/inference/issue-107090.stderr
index e509e262fb1..55825f7765b 100644
--- a/tests/ui/inference/issue-107090.stderr
+++ b/tests/ui/inference/issue-107090.stderr
@@ -66,6 +66,19 @@ LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short,
    |           |
    |           help: consider introducing lifetime `'short` here: `'short,`
 
-error: aborting due to 6 previous errors
+error[E0308]: mismatched types
+  --> $DIR/issue-107090.rs:22:5
+   |
+LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T {
+   |                       - expected this type parameter                                    ------- expected `&'out T` because of return type
+LL |
+LL |     sadness.cast()
+   |     ^^^^^^^^^^^^^^ expected `&T`, found `&Foo<'_, '_, T>`
+   |
+   = note: expected reference `&'out T`
+              found reference `&Foo<'_, '_, T>`
+
+error: aborting due to 7 previous errors
 
-For more information about this error, try `rustc --explain E0261`.
+Some errors have detailed explanations: E0261, E0308.
+For more information about an error, try `rustc --explain E0261`.