]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/bound-normalization-fail.stderr
Rollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper
[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 LL |
7 LL |         Foo(())
8    |         ------- return type was inferred to be `Foo<()>` here
9    |
10 note: expected this to be `()`
11   --> $DIR/bound-normalization-fail.rs:14:19
12    |
13 LL |     type Output = T;
14    |                   ^
15    = note:    expected unit type `()`
16            found associated type `<T as impl_trait::Trait>::Assoc`
17 help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
18    |
19 LL |     fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
20    |                         ++++++++++++
21
22 error[E0658]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
23   --> $DIR/bound-normalization-fail.rs:41:41
24    |
25 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
26    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27    |
28    = note: see issue #103532 <https://github.com/rust-lang/rust/issues/103532> for more information
29    = help: add `#![feature(impl_trait_projections)]` to the crate attributes to enable
30
31 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'a>>::Assoc`
32   --> $DIR/bound-normalization-fail.rs:41:41
33    |
34 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
35    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'a>>::Assoc`
36 ...
37 LL |         Foo(())
38    |         ------- return type was inferred to be `Foo<()>` here
39    |
40 note: expected this to be `()`
41   --> $DIR/bound-normalization-fail.rs:14:19
42    |
43 LL |     type Output = T;
44    |                   ^
45    = note:    expected unit type `()`
46            found associated type `<T as lifetimes::Trait<'a>>::Assoc`
47 help: consider constraining the associated type `<T as lifetimes::Trait<'a>>::Assoc` to `()`
48    |
49 LL |     fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
50    |                                 ++++++++++++
51
52 error: aborting due to 3 previous errors
53
54 Some errors have detailed explanations: E0271, E0658.
55 For more information about an error, try `rustc --explain E0271`.