fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.9 KiB45 linesraw
1error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as Trait>::Assoc`
2  --> $DIR/bound-normalization-fail.rs:25:32
3   |
4LL |     fn foo_fail<T: Trait>() -> impl FooLike<Output = T::Assoc> {
5   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as Trait>::Assoc`
6LL |
7LL |         Foo(())
8   |         ------- return type was inferred to be `Foo<()>` here
9   |
10note: expected this to be `()`
11  --> $DIR/bound-normalization-fail.rs:14:19
12   |
13LL |     type Output = T;
14   |                   ^
15   = note:    expected unit type `()`
16           found associated type `<T as impl_trait::Trait>::Assoc`
17help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
18   |
19LL |     fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
20   |                         ++++++++++++
21
22error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as Trait<'a>>::Assoc`
23  --> $DIR/bound-normalization-fail.rs:41:41
24   |
25LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
26   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as Trait<'a>>::Assoc`
27LL |
28LL |         Foo(())
29   |         ------- return type was inferred to be `Foo<()>` here
30   |
31note: expected this to be `()`
32  --> $DIR/bound-normalization-fail.rs:14:19
33   |
34LL |     type Output = T;
35   |                   ^
36   = note:    expected unit type `()`
37           found associated type `<T as lifetimes::Trait<'a>>::Assoc`
38help: consider constraining the associated type `<T as lifetimes::Trait<'a>>::Assoc` to `()`
39   |
40LL |     fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
41   |                                 ++++++++++++
42
43error: aborting due to 2 previous errors
44
45For more information about this error, try `rustc --explain E0271`.