]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/bound-normalization-fail.stderr
New upstream version 1.45.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 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 = note: the return type of a function must have a statically known size
19 help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
20 |
21 LL | fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output=T::Assoc> {
22 | ^^^^^^^^^^^^
23
24 error: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
25 --> $DIR/bound-normalization-fail.rs:43:41
26 |
27 LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29
30 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
31 --> $DIR/bound-normalization-fail.rs:43:41
32 |
33 LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
34 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
35 |
36 = note: expected type `()`
37 found associated type `<T as lifetimes::Trait<'static>>::Assoc`
38 = note: the return type of a function must have a statically known size
39 help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
40 |
41 LL | fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output=T::Assoc> {
42 | ^^^^^^^^^^^^
43
44 error: aborting due to 3 previous errors; 1 warning emitted
45
46 For more information about this error, try `rustc --explain E0271`.