]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/type-alias-impl-trait/inference-cycle.stderr
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / inference-cycle.stderr
index e12124664778ed249087f4e88bb0011577b7e323..3ed86fae8a18de54ec6d4c4ba3ba522a49360ae5 100644 (file)
@@ -5,11 +5,10 @@ LL |     type Foo = impl std::fmt::Debug;
    |                ^^^^^^^^^^^^^^^^^^^^
    |
 note: ...which requires type-checking `m::bar`...
-  --> $DIR/inference-cycle.rs:15:9
+  --> $DIR/inference-cycle.rs:15:5
    |
-LL |         is_send(foo()); // Today: error
-   |         ^^^^^^^
-   = note: ...which requires evaluating trait selection obligation `impl core::fmt::Debug: core::marker::Send`...
+LL |     pub fn bar() {
+   |     ^^^^^^^^^^^^
    = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
 note: cycle used when checking item types in module `m`
   --> $DIR/inference-cycle.rs:4:1
@@ -17,21 +16,24 @@ note: cycle used when checking item types in module `m`
 LL | mod m {
    | ^^^^^
 
-error[E0308]: mismatched types
-  --> $DIR/inference-cycle.rs:19:22
+error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
+  --> $DIR/inference-cycle.rs:5:16
    |
 LL |     type Foo = impl std::fmt::Debug;
-   |                -------------------- the expected opaque type
-...
-LL |         let f: Foo = 22_u32;
-   |                ---   ^^^^^^ expected opaque type, found `u32`
-   |                |
-   |                expected due to this
-   |
-   = note: expected opaque type `impl Debug`
-                     found type `u32`
+   |                ^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...which requires type-checking `m::bar`...
+  --> $DIR/inference-cycle.rs:15:5
+   |
+LL |     pub fn bar() {
+   |     ^^^^^^^^^^^^
+   = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in module `m`
+  --> $DIR/inference-cycle.rs:4:1
+   |
+LL | mod m {
+   | ^^^^^
 
 error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0308, E0391.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0391`.