-
Notifications
You must be signed in to change notification settings - Fork 13k
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
add name bindings for bad imports #31209
Comments
@nrc: Trying to understand where the dummy definition inserting should occur. From looking at the linked PR and |
Should probably happen in this function: https://dxr.mozilla.org/rust/source/src/librustc_resolve/lib.rs#1861-1888 Or possibly one of its callers. |
@nrc: Ohhh, that definitely seems like the right place. I'll give this a shot tomorrow; thanks for pointing me in the right direction! |
@nrc: If I've read things correctly, it looks like that Both of those paths, however, converge on |
Every error ends up converging in resolve_struct_error, so I am wary about putting anything there except for formatting error messages, etc. I would add some code to resolve_imports, you might want to factor that into a function if it is complex or repeated. |
@nrc: Understood, thanks. I'll give that a shot. 😄 |
…=nrc WIP implementation of #31209. The goal is to insert fake/dummy definitions for names that we failed to import so that later resolver stages won't complain about them.
Closed by #31338 |
e.g.,
Assuming
bar
doesn't exist, we signal two errors here - one on theuse
and one on the call. We should insert a dummy definition forbar
so we don't signal the second error.Note that this is somewhat fixing a regression caused by #31065
The text was updated successfully, but these errors were encountered: