fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
2.0 KiB63 linesraw
1error[E0308]: mismatched types
2  --> $DIR/equality2.rs:25:18
3   |
4LL | fn hide<T: Foo>(x: T) -> impl Foo {
5   |                          -------- the found opaque type
6...
7LL |     let _: u32 = hide(0_u32);
8   |            ---   ^^^^^^^^^^^ expected `u32`, found opaque type
9   |            |
10   |            expected due to this
11   |
12   = note:     expected type `u32`
13           found opaque type `impl Foo`
14
15error[E0308]: mismatched types
16  --> $DIR/equality2.rs:31:18
17   |
18LL | fn hide<T: Foo>(x: T) -> impl Foo {
19   |                          -------- the found opaque type
20...
21LL |     let _: i32 = Leak::leak(hide(0_i32));
22   |            ---   ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found associated type
23   |            |
24   |            expected due to this
25   |
26   = note:         expected type `i32`
27           found associated type `<impl Foo as Leak>::T`
28   = note: consider constraining the associated type `<impl Foo as Leak>::T` to `i32`
29   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
30
31error[E0308]: mismatched types
32  --> $DIR/equality2.rs:38:10
33   |
34LL | fn hide<T: Foo>(x: T) -> impl Foo {
35   |                          --------
36   |                          |
37   |                          the expected opaque type
38   |                          the found opaque type
39...
40LL |     x = (x.1,
41   |          ^^^ expected `u32`, found `i32`
42   |
43   = note: expected opaque type `impl Foo` (`u32`)
44              found opaque type `impl Foo` (`i32`)
45
46error[E0308]: mismatched types
47  --> $DIR/equality2.rs:41:10
48   |
49LL | fn hide<T: Foo>(x: T) -> impl Foo {
50   |                          --------
51   |                          |
52   |                          the expected opaque type
53   |                          the found opaque type
54...
55LL |          x.0);
56   |          ^^^ expected `i32`, found `u32`
57   |
58   = note: expected opaque type `impl Foo` (`i32`)
59              found opaque type `impl Foo` (`u32`)
60
61error: aborting due to 4 previous errors
62
63For more information about this error, try `rustc --explain E0308`.