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