fork/rust

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

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

master
1.1 KiB26 linesraw
1error[E0271]: type mismatch resolving `<dyn Trait<A = A, B = B> as SuperTrait>::A == B`
2  --> $DIR/enforce-supertrait-projection.rs:9:17
3   |
4LL | fn transmute<A, B>(x: A) -> B {
5   |              -  - expected type parameter
6   |              |
7   |              found type parameter
8LL |     foo::<A, B, dyn Trait<A = A, B = B>>(x)
9   |                 ^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `B`, found type parameter `A`
10   |
11   = note: expected type parameter `B`
12              found type parameter `A`
13   = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
14   = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
15note: required by a bound in `foo`
16  --> $DIR/enforce-supertrait-projection.rs:15:8
17   |
18LL | fn foo<A, B, T: ?Sized>(x: T::A) -> B
19   |    --- required by a bound in this function
20LL | where
21LL |     T: Trait<B = B>,
22   |        ^^^^^^^^^^^^ required by this bound in `foo`
23
24error: aborting due to previous error
25
26For more information about this error, try `rustc --explain E0271`.