]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/bound-normalization-fail.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / impl-trait / bound-normalization-fail.stderr
CommitLineData
416331ca
XL
1warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
2 --> $DIR/bound-normalization-fail.rs:5:12
3 |
4LL | #![feature(impl_trait_in_bindings)]
5 | ^^^^^^^^^^^^^^^^^^^^^^
6 |
7 = note: `#[warn(incomplete_features)]` on by default
8
9error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
e1599b0c 10 --> $DIR/bound-normalization-fail.rs:28:32
416331ca
XL
11 |
12LL | fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
60c5eb7d 13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
416331ca 14 |
60c5eb7d
XL
15 = note: expected type `()`
16 found associated type `<T as impl_trait::Trait>::Assoc`
e1599b0c
XL
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
416331ca
XL
19 = note: the return type of a function must have a statically known size
20
e1599b0c
XL
21error: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
22 --> $DIR/bound-normalization-fail.rs:44:41
23 |
24LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
416331ca 27error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
e1599b0c 28 --> $DIR/bound-normalization-fail.rs:44:41
416331ca
XL
29 |
30LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
60c5eb7d 31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
416331ca 32 |
60c5eb7d
XL
33 = note: expected type `()`
34 found associated type `<T as lifetimes::Trait<'static>>::Assoc`
e1599b0c
XL
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
416331ca
XL
37 = note: the return type of a function must have a statically known size
38
e1599b0c 39error: aborting due to 3 previous errors
416331ca
XL
40
41For more information about this error, try `rustc --explain E0271`.