-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhelpful "Sized not implemented for str" (or slices) after method lookup error. #33575
Comments
cc @nrc |
I'd expect a simple fix for this would be to actually set |
I just spent a lot of time looking at a Because I don't know if |
That doesn't really work out, since the issue here is that inference gets a free pass instead of inferring |
I'm not saying that the type should be inferred to something else from the code below (like you said it was happening in the issue description) -- that seems bad. But on the other hand the compiler should probably not report an error every place the type or variable is used. |
I just reread, and:
That's not relevant here - the problem is inference flows up into the variable, which is correct in other cases but in this case it infers the slice type which is unsized. The |
The underlying cause is that we have two maps for |
…tril Propagate `types.err` in locals further to avoid spurious knock-down errors Fix rust-lang#33575, fix rust-lang#44504.
Because of the method error,
x
doesn't get a type (not evenTyError
, AFAICT), and then it gets inferred tostr
from another call in the function, which results in the unsized variable error.The text was updated successfully, but these errors were encountered: