]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/bound-normalization-fail.stderr
New upstream version 1.43.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / bound-normalization-fail.stderr
1 warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
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
9 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
10 --> $DIR/bound-normalization-fail.rs:27:32
11 |
12 LL | fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
14 |
15 = note: expected type `()`
16 found associated type `<T as impl_trait::Trait>::Assoc`
17 = note: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
18 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
19 = note: the return type of a function must have a statically known size
20
21 error: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
22 --> $DIR/bound-normalization-fail.rs:43:41
23 |
24 LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
27 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
28 --> $DIR/bound-normalization-fail.rs:43:41
29 |
30 LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
32 |
33 = note: expected type `()`
34 found associated type `<T as lifetimes::Trait<'static>>::Assoc`
35 = note: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
36 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
37 = note: the return type of a function must have a statically known size
38
39 error: aborting due to 3 previous errors
40
41 For more information about this error, try `rustc --explain E0271`.