-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Function-local types are not resolved #1559
Comments
Yeah, we just don't support local items at all yet :( |
See #1165. |
Funny, the original example now seems to resolve, but not if it's a record struct. |
Hmm, maybe #2600 partially implemented this.
|
I think you're right. I wonder why unit and tuple structs work but not record ones.
I wish :-). |
I am not sure if this is the same issue or not, but my gut says it is. Please correct me if I am wrong and I will create a new one. In the below working code, |
Yeah, it looks like the same issue. |
That (a local impl used outside that block) is actually a special case that might never be supported by RA, and IMO should be deprecated in the language. We don't want to have to parse all function (or constant) bodies just because they might contain an impl that we need; this would have a bad impact on lazyness.
If the impl is only used in that block, that's fine, but I don't see the point otherwise. |
I agree about the impact but I think we should partially support this, i.e. only if we encounter them in I don't think there's another way to solve the issue of scoping restrictions in expanded proc-macros. |
Again, I don't see the point. Note that we certainly want to support using impls defined in the same block. But if you're relying on the fact that impls in blocks are available outside of that block, I don't see how that's solving any scoping issue. |
The issue with |
Same for type aliases. Found in #1549.
The text was updated successfully, but these errors were encountered: