Description
#39361 improved our error messages around uninferable types, but there is still room to do better. For one thing, as @arielb1 pointed out, we currently detect these errors in a kind of odd place (when a Sized
obligation is not matchable). We could generalize this to any obligation that includes an unresolved inference variable, I suspect. Moreover, there are cases where we don't encounter the error about an unconstrained inference variable until writeback:
fn main() {
let x = [];
}
Therefore, the error reporting for unknown types in writeback ought to use the new helpers introduced in #39361
cc @cengizio -- would you like to keep on working on this?
UPDATE: I was wrong to say this behavior applies any time we have an unresolved obligation. Sometimes it does, but not always.