]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/bound-normalization-fail.stderr
Auto merge of #88672 - camelid:inc-parser-sugg, r=davidtwco
[rust.git] / src / test / ui / impl-trait / bound-normalization-fail.stderr
1 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
2   --> $DIR/bound-normalization-fail.rs:25:32
3    |
4 LL |     fn foo_fail<T: Trait>() -> impl FooLike<Output = T::Assoc> {
5    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
6    |
7 note: expected this to be `()`
8   --> $DIR/bound-normalization-fail.rs:14:19
9    |
10 LL |     type Output = T;
11    |                   ^
12    = note:    expected unit type `()`
13            found associated type `<T as impl_trait::Trait>::Assoc`
14 help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
15    |
16 LL |     fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
17    |                         ++++++++++++
18
19 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
20   --> $DIR/bound-normalization-fail.rs:25:64
21    |
22 LL |       fn foo_fail<T: Trait>() -> impl FooLike<Output = T::Assoc> {
23    |  ________________________________________________________________^
24 LL | |
25 LL | |
26 LL | |         Foo(())
27 LL | |     }
28    | |_____^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
29    |
30 note: expected this to be `()`
31   --> $DIR/bound-normalization-fail.rs:14:19
32    |
33 LL |     type Output = T;
34    |                   ^
35    = note:    expected unit type `()`
36            found associated type `<T as impl_trait::Trait>::Assoc`
37 help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
38    |
39 LL |     fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
40    |                         ++++++++++++
41
42 error[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
43   --> $DIR/bound-normalization-fail.rs:42:41
44    |
45 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
46    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
48 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
49   --> $DIR/bound-normalization-fail.rs:42:41
50    |
51 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
52    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
53    |
54 note: expected this to be `()`
55   --> $DIR/bound-normalization-fail.rs:14:19
56    |
57 LL |     type Output = T;
58    |                   ^
59    = note:    expected unit type `()`
60            found associated type `<T as lifetimes::Trait<'static>>::Assoc`
61 help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
62    |
63 LL |     fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
64    |                                 ++++++++++++
65
66 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
67   --> $DIR/bound-normalization-fail.rs:42:73
68    |
69 LL |       fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
70    |  _________________________________________________________________________^
71 LL | |
72 LL | |
73 LL | |
74 LL | |         Foo(())
75 LL | |     }
76    | |_____^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
77    |
78 note: expected this to be `()`
79   --> $DIR/bound-normalization-fail.rs:14:19
80    |
81 LL |     type Output = T;
82    |                   ^
83    = note:    expected unit type `()`
84            found associated type `<T as lifetimes::Trait<'static>>::Assoc`
85 help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
86    |
87 LL |     fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
88    |                                 ++++++++++++
89
90 error: aborting due to 5 previous errors
91
92 Some errors have detailed explanations: E0271, E0760.
93 For more information about an error, try `rustc --explain E0271`.