about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/const-generics/occurs-check/unused-substs-2.rs5
-rw-r--r--tests/ui/const-generics/occurs-check/unused-substs-2.stderr6
-rw-r--r--tests/ui/const-generics/occurs-check/unused-substs-5.stderr6
-rw-r--r--tests/ui/impl-trait/issues/issue-84073.rs2
-rw-r--r--tests/ui/impl-trait/issues/issue-84073.stderr13
-rw-r--r--tests/ui/infinite/infinite-autoderef.rs4
-rw-r--r--tests/ui/infinite/infinite-autoderef.stderr55
-rw-r--r--tests/ui/issues/issue-59494.rs2
-rw-r--r--tests/ui/issues/issue-59494.stderr19
-rw-r--r--tests/ui/occurs-check-2.rs3
-rw-r--r--tests/ui/occurs-check-2.stderr11
-rw-r--r--tests/ui/occurs-check-3.rs10
-rw-r--r--tests/ui/occurs-check-3.stderr10
-rw-r--r--tests/ui/occurs-check.rs5
-rw-r--r--tests/ui/occurs-check.stderr13
-rw-r--r--tests/ui/span/coerce-suggestions.rs4
-rw-r--r--tests/ui/span/coerce-suggestions.stderr13
17 files changed, 48 insertions, 133 deletions
diff --git a/tests/ui/const-generics/occurs-check/unused-substs-2.rs b/tests/ui/const-generics/occurs-check/unused-substs-2.rs
index 84e24d1a3f5..5bdd3e39806 100644
--- a/tests/ui/const-generics/occurs-check/unused-substs-2.rs
+++ b/tests/ui/const-generics/occurs-check/unused-substs-2.rs
@@ -20,9 +20,10 @@ impl<T> Bind<T> for Foo<{ 6 + 1 }> {
 
 fn main() {
     let (mut t, foo) = Foo::bind();
+    //~^ ERROR mismatched types
+    //~| NOTE cyclic type
+
     // `t` is `ty::Infer(TyVar(?1t))`
     // `foo` contains `ty::Infer(TyVar(?1t))` in its substs
     t = foo;
-    //~^ ERROR mismatched types
-    //~| NOTE cyclic type
 }
diff --git a/tests/ui/const-generics/occurs-check/unused-substs-2.stderr b/tests/ui/const-generics/occurs-check/unused-substs-2.stderr
index 4b1b9f20559..a2c4dec4724 100644
--- a/tests/ui/const-generics/occurs-check/unused-substs-2.stderr
+++ b/tests/ui/const-generics/occurs-check/unused-substs-2.stderr
@@ -1,8 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/unused-substs-2.rs:25:9
+  --> $DIR/unused-substs-2.rs:22:24
    |
-LL |     t = foo;
-   |         ^^^ cyclic type of infinite size
+LL |     let (mut t, foo) = Foo::bind();
+   |                        ^^^^^^^^^^^ cyclic type of infinite size
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/occurs-check/unused-substs-5.stderr b/tests/ui/const-generics/occurs-check/unused-substs-5.stderr
index 1b3a5492328..46230d455b2 100644
--- a/tests/ui/const-generics/occurs-check/unused-substs-5.stderr
+++ b/tests/ui/const-generics/occurs-check/unused-substs-5.stderr
@@ -1,10 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/unused-substs-5.rs:15:9
+  --> $DIR/unused-substs-5.rs:15:19
    |
 LL |     x = q::<_, N>(x);
-   |         ^^^^^^^^^^^^- help: try using a conversion method: `.to_vec()`
-   |         |
-   |         cyclic type of infinite size
+   |                   ^ cyclic type of infinite size
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/issues/issue-84073.rs b/tests/ui/impl-trait/issues/issue-84073.rs
index 49a34ccfa3b..60f98a7c7b5 100644
--- a/tests/ui/impl-trait/issues/issue-84073.rs
+++ b/tests/ui/impl-trait/issues/issue-84073.rs
@@ -29,5 +29,5 @@ where
 }
 
 fn main() {
-    Race::new(|race| race.when()); //~ ERROR type annotations needed
+    Race::new(|race| race.when()); //~ ERROR overflow evaluating the requirement `_ <: Option<_>`
 }
diff --git a/tests/ui/impl-trait/issues/issue-84073.stderr b/tests/ui/impl-trait/issues/issue-84073.stderr
index d03e458aeb8..b9039211db6 100644
--- a/tests/ui/impl-trait/issues/issue-84073.stderr
+++ b/tests/ui/impl-trait/issues/issue-84073.stderr
@@ -1,14 +1,9 @@
-error[E0282]: type annotations needed for `RaceBuilder<T, Never<T>>`
-  --> $DIR/issue-84073.rs:32:16
+error[E0275]: overflow evaluating the requirement `_ <: Option<_>`
+  --> $DIR/issue-84073.rs:32:22
    |
 LL |     Race::new(|race| race.when());
-   |                ^^^^  ---- type must be known at this point
-   |
-help: consider giving this closure parameter an explicit type, where the type for type parameter `T` is specified
-   |
-LL |     Race::new(|race: RaceBuilder<T, Never<T>>| race.when());
-   |                    ++++++++++++++++++++++++++
+   |                      ^^^^
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0282`.
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/infinite/infinite-autoderef.rs b/tests/ui/infinite/infinite-autoderef.rs
index d6956e69457..cf5c9fe5678 100644
--- a/tests/ui/infinite/infinite-autoderef.rs
+++ b/tests/ui/infinite/infinite-autoderef.rs
@@ -1,6 +1,3 @@
-//@ error-pattern: reached the recursion limit while auto-dereferencing
-//@ compile-flags: -Zdeduplicate-diagnostics=yes
-
 use std::ops::Deref;
 
 struct Foo;
@@ -17,6 +14,7 @@ pub fn main() {
     let mut x;
     loop {
         x = Box::new(x);
+        //~^ ERROR overflow evaluating the requirement `Box<_> <: _`
         x.foo;
         x.bar();
     }
diff --git a/tests/ui/infinite/infinite-autoderef.stderr b/tests/ui/infinite/infinite-autoderef.stderr
index 51b61e3a66b..24be1a11373 100644
--- a/tests/ui/infinite/infinite-autoderef.stderr
+++ b/tests/ui/infinite/infinite-autoderef.stderr
@@ -1,54 +1,9 @@
-error[E0308]: mismatched types
-  --> $DIR/infinite-autoderef.rs:19:13
+error[E0275]: overflow evaluating the requirement `Box<_> <: _`
+  --> $DIR/infinite-autoderef.rs:16:13
    |
 LL |         x = Box::new(x);
-   |             ^^^^^^^^^^^ cyclic type of infinite size
-   |
-help: consider unboxing the value
-   |
-LL |         x = *Box::new(x);
-   |             +
-
-error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
-  --> $DIR/infinite-autoderef.rs:24:5
-   |
-LL |     Foo.foo;
-   |     ^^^^^^^ deref recursion limit reached
-   |
-   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_autoderef`)
-
-error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
-  --> $DIR/infinite-autoderef.rs:24:9
-   |
-LL |     Foo.foo;
-   |         ^^^ deref recursion limit reached
-   |
-   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_autoderef`)
-
-error[E0609]: no field `foo` on type `Foo`
-  --> $DIR/infinite-autoderef.rs:24:9
-   |
-LL |     Foo.foo;
-   |         ^^^ unknown field
-
-error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
-  --> $DIR/infinite-autoderef.rs:25:9
-   |
-LL |     Foo.bar();
-   |         ^^^ deref recursion limit reached
-   |
-   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`infinite_autoderef`)
-
-error[E0599]: no method named `bar` found for struct `Foo` in the current scope
-  --> $DIR/infinite-autoderef.rs:25:9
-   |
-LL | struct Foo;
-   | ---------- method `bar` not found for this struct
-...
-LL |     Foo.bar();
-   |         ^^^ method not found in `Foo`
+   |             ^^^^^^^^^^^
 
-error: aborting due to 6 previous errors
+error: aborting due to 1 previous error
 
-Some errors have detailed explanations: E0055, E0308, E0599, E0609.
-For more information about an error, try `rustc --explain E0055`.
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/issues/issue-59494.rs b/tests/ui/issues/issue-59494.rs
index 8dcdd88c618..b4d50bd4ce7 100644
--- a/tests/ui/issues/issue-59494.rs
+++ b/tests/ui/issues/issue-59494.rs
@@ -18,6 +18,6 @@ fn main() {
     let f = |(_, _)| {};
     let g = |(a, _)| a;
     let t7 = |env| |a| |b| t7p(f, g)(((env, a), b));
+    //~^ ERROR mismatched types
     let t8 = t8n(t7, t7p(f, g));
-    //~^ ERROR: expected a `Fn(_)` closure, found `impl Fn(((_, _), _))` [E0277]
 }
diff --git a/tests/ui/issues/issue-59494.stderr b/tests/ui/issues/issue-59494.stderr
index 960de1be299..33d3e48c1aa 100644
--- a/tests/ui/issues/issue-59494.stderr
+++ b/tests/ui/issues/issue-59494.stderr
@@ -1,18 +1,9 @@
-error[E0277]: expected a `Fn(_)` closure, found `impl Fn(((_, _), _))`
-  --> $DIR/issue-59494.rs:21:22
+error[E0308]: mismatched types
+  --> $DIR/issue-59494.rs:20:40
    |
-LL |     let t8 = t8n(t7, t7p(f, g));
-   |              ---     ^^^^^^^^^ expected an `Fn(_)` closure, found `impl Fn(((_, _), _))`
-   |              |
-   |              required by a bound introduced by this call
-   |
-   = help: the trait `Fn<(_,)>` is not implemented for `impl Fn(((_, _), _))`
-note: required by a bound in `t8n`
-  --> $DIR/issue-59494.rs:5:45
-   |
-LL | fn t8n<A, B, C>(f: impl Fn(A) -> B, g: impl Fn(A) -> C) -> impl Fn(A) -> (B, C)
-   |                                             ^^^^^^^^^^ required by this bound in `t8n`
+LL |     let t7 = |env| |a| |b| t7p(f, g)(((env, a), b));
+   |                                        ^^^ cyclic type of infinite size
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/occurs-check-2.rs b/tests/ui/occurs-check-2.rs
index f36682a3dd8..6cdb757d65b 100644
--- a/tests/ui/occurs-check-2.rs
+++ b/tests/ui/occurs-check-2.rs
@@ -5,6 +5,5 @@ fn main() {
 
     g = f;
     f = Box::new(g);
-    //~^  ERROR mismatched types
-    //~| cyclic type of infinite size
+    //~^ ERROR overflow evaluating the requirement `Box<_> <: _`
 }
diff --git a/tests/ui/occurs-check-2.stderr b/tests/ui/occurs-check-2.stderr
index 7b6fb9fafa2..acc474319b0 100644
--- a/tests/ui/occurs-check-2.stderr
+++ b/tests/ui/occurs-check-2.stderr
@@ -1,14 +1,9 @@
-error[E0308]: mismatched types
+error[E0275]: overflow evaluating the requirement `Box<_> <: _`
   --> $DIR/occurs-check-2.rs:7:9
    |
 LL |     f = Box::new(g);
-   |         ^^^^^^^^^^^ cyclic type of infinite size
-   |
-help: consider unboxing the value
-   |
-LL |     f = *Box::new(g);
-   |         +
+   |         ^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/occurs-check-3.rs b/tests/ui/occurs-check-3.rs
index 9c04204010b..cdf8dc3bd16 100644
--- a/tests/ui/occurs-check-3.rs
+++ b/tests/ui/occurs-check-3.rs
@@ -1,5 +1,11 @@
 // From Issue #778
 
 enum Clam<T> { A(T) }
-fn main() { let c; c = Clam::A(c); match c { Clam::A::<isize>(_) => { } } }
-//~^ ERROR mismatched types
+fn main() {
+    let c;
+    c = Clam::A(c);
+    //~^ ERROR overflow evaluating the requirement `Clam<_> <: _`
+    match c {
+        Clam::A::<isize>(_) => { }
+    }
+}
diff --git a/tests/ui/occurs-check-3.stderr b/tests/ui/occurs-check-3.stderr
index 675133b6d50..7bc28e61d9f 100644
--- a/tests/ui/occurs-check-3.stderr
+++ b/tests/ui/occurs-check-3.stderr
@@ -1,9 +1,9 @@
-error[E0308]: mismatched types
-  --> $DIR/occurs-check-3.rs:4:24
+error[E0275]: overflow evaluating the requirement `Clam<_> <: _`
+  --> $DIR/occurs-check-3.rs:6:9
    |
-LL | fn main() { let c; c = Clam::A(c); match c { Clam::A::<isize>(_) => { } } }
-   |                        ^^^^^^^^^^ cyclic type of infinite size
+LL |     c = Clam::A(c);
+   |         ^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/occurs-check.rs b/tests/ui/occurs-check.rs
index aec52d83976..3fae3ff1238 100644
--- a/tests/ui/occurs-check.rs
+++ b/tests/ui/occurs-check.rs
@@ -1,8 +1,5 @@
 fn main() {
-
     let f;
-
     f = Box::new(f);
-    //~^ ERROR mismatched types
-    //~| cyclic type of infinite size
+    //~^ ERROR overflow evaluating the requirement `Box<_> <: _`
 }
diff --git a/tests/ui/occurs-check.stderr b/tests/ui/occurs-check.stderr
index 1cb6b32cb23..3f61d8fd08d 100644
--- a/tests/ui/occurs-check.stderr
+++ b/tests/ui/occurs-check.stderr
@@ -1,14 +1,9 @@
-error[E0308]: mismatched types
-  --> $DIR/occurs-check.rs:5:9
+error[E0275]: overflow evaluating the requirement `Box<_> <: _`
+  --> $DIR/occurs-check.rs:3:9
    |
 LL |     f = Box::new(f);
-   |         ^^^^^^^^^^^ cyclic type of infinite size
-   |
-help: consider unboxing the value
-   |
-LL |     f = *Box::new(f);
-   |         +
+   |         ^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/span/coerce-suggestions.rs b/tests/ui/span/coerce-suggestions.rs
index 7920ae0b26c..13331a016fc 100644
--- a/tests/ui/span/coerce-suggestions.rs
+++ b/tests/ui/span/coerce-suggestions.rs
@@ -13,10 +13,6 @@ fn main() {
     //~^ ERROR E0308
     test2(&y);
     //~^ ERROR E0308
-    let f;
-    f = Box::new(f);
-    //~^ ERROR E0308
-
     let s = &mut String::new();
     s = format!("foo");
     //~^ ERROR E0308
diff --git a/tests/ui/span/coerce-suggestions.stderr b/tests/ui/span/coerce-suggestions.stderr
index ff840b781f0..77b01ee08b7 100644
--- a/tests/ui/span/coerce-suggestions.stderr
+++ b/tests/ui/span/coerce-suggestions.stderr
@@ -54,22 +54,11 @@ LL | fn test2(_x: &mut i32) {}
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:17:9
    |
-LL |     f = Box::new(f);
-   |         ^^^^^^^^^^^ cyclic type of infinite size
-   |
-help: consider unboxing the value
-   |
-LL |     f = *Box::new(f);
-   |         +
-
-error[E0308]: mismatched types
-  --> $DIR/coerce-suggestions.rs:21:9
-   |
 LL |     s = format!("foo");
    |         ^^^^^^^^^^^^^^ expected `&mut String`, found `String`
    |
    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0308`.