You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#131795 - compiler-errors:expectation, r=Nadrieril
Stop inverting expectation in normalization errors
We have some funky special case logic to invert the expectation and actual type for normalization errors depending on their cause code. IMO most of the error messages get better, except for `try {}` blocks' type expectations. I think that these need to be special cased in some other way, rather than via this hack.
Fixesrust-lang#131763
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `u32`
11
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found associated type
12
12
...
13
13
LL | Box::new(1..=10) as Box<dyn Iterator>
14
14
| ------------------------------------- return type was inferred to be `Box<dyn Iterator>` here
15
15
|
16
-
= note: expected associated type `<dyn Iterator as Iterator>::Item`
17
-
found type `u32`
18
-
= help: consider constraining the associated type `<dyn Iterator as Iterator>::Item` to `u32` or calling a method that returns `<dyn Iterator as Iterator>::Item`
16
+
= note: expected type `u32`
17
+
found associated type `<dyn Iterator as Iterator>::Item`
18
+
= help: consider constraining the associated type `<dyn Iterator as Iterator>::Item` to `u32`
19
19
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
0 commit comments