fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
2.1 KiB41 linesraw
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`
10  --> $DIR/bound-normalization-fail.rs:28:32
11   |
12LL |     fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
13   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
14   |
15   = note: expected type `()`
16              found 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
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
27error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
28  --> $DIR/bound-normalization-fail.rs:44:41
29   |
30LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
31   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
32   |
33   = note: expected type `()`
34              found 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
39error: aborting due to 3 previous errors
40
41For more information about this error, try `rustc --explain E0271`.