]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/bound-normalization-fail.stderr
Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20
[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 `<T as impl_trait::Trait>::Assoc`
8   --> $DIR/bound-normalization-fail.rs:14:19
9    |
10 LL |     type Output = T;
11    |                   ^
12    = note: expected associated type `<T as impl_trait::Trait>::Assoc`
13                     found unit type `()`
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[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
20   --> $DIR/bound-normalization-fail.rs:41:41
21    |
22 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
23    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
26   --> $DIR/bound-normalization-fail.rs:41:41
27    |
28 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
29    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
30    |
31 note: expected this to be `<T as lifetimes::Trait<'static>>::Assoc`
32   --> $DIR/bound-normalization-fail.rs:14:19
33    |
34 LL |     type Output = T;
35    |                   ^
36    = note: expected associated type `<T as lifetimes::Trait<'static>>::Assoc`
37                     found unit type `()`
38 help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
39    |
40 LL |     fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
41    |                                 ++++++++++++
42
43 error: aborting due to 3 previous errors
44
45 Some errors have detailed explanations: E0271, E0760.
46 For more information about an error, try `rustc --explain E0271`.