fork/rust

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

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.3 KiB33 linesraw
1error[E0308]: mismatched types
2  --> $DIR/specialization-default-projection.rs:21:5
3   |
4LL | fn generic<T>() -> <T as Foo>::Assoc {
5   |                    ----------------- expected `<T as Foo>::Assoc` because of return type
6...
7LL |     ()
8   |     ^^ expected associated type, found `()`
9   |
10   = note: expected associated type `<T as Foo>::Assoc`
11                    found unit type `()`
12   = note: consider constraining the associated type `<T as Foo>::Assoc` to `()` or calling a method that returns `<T as Foo>::Assoc`
13   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
14
15error[E0308]: mismatched types
16  --> $DIR/specialization-default-projection.rs:28:5
17   |
18LL | fn monomorphic() -> () {
19   |                     -- expected `()` because of return type
20...
21LL |     generic::<()>()
22   |     ^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
23   |     |
24   |     expected `()`, found associated type
25   |
26   = note:    expected unit type `()`
27           found associated type `<() as Foo>::Assoc`
28   = note: consider constraining the associated type `<() as Foo>::Assoc` to `()`
29   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0308`.