]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/bound-normalization-fail.stderr
Check opaque types satisfy their bounds
[rust.git] / src / test / ui / impl-trait / bound-normalization-fail.stderr
1 warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
2   --> $DIR/bound-normalization-fail.rs:4:12
3    |
4 LL | #![feature(impl_trait_in_bindings)]
5    |            ^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `#[warn(incomplete_features)]` on by default
8    = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
9
10 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
11   --> $DIR/bound-normalization-fail.rs:27:32
12    |
13 LL |     fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
14    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
15    |
16    = note:         expected type `()`
17            found associated type `<T as impl_trait::Trait>::Assoc`
18 help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
19    |
20 LL |     fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output=T::Assoc> {
21    |                         ^^^^^^^^^^^^
22
23 error[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
24   --> $DIR/bound-normalization-fail.rs:43:41
25    |
26 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
27    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
29 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
30   --> $DIR/bound-normalization-fail.rs:43:41
31    |
32 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
33    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
34    |
35    = note:         expected type `()`
36            found associated type `<T as lifetimes::Trait<'static>>::Assoc`
37 help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
38    |
39 LL |     fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output=T::Assoc> {
40    |                                 ^^^^^^^^^^^^
41
42 error: aborting due to 3 previous errors; 1 warning emitted
43
44 Some errors have detailed explanations: E0271, E0760.
45 For more information about an error, try `rustc --explain E0271`.