Skip to content

Possibly merge resolve_definition_of_name_in_module with resolve_name_in_module #4952

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

Closed
catamorphism opened this issue Feb 15, 2013 · 6 comments
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@catamorphism
Copy link
Contributor

As per comment in the former function in resolve.

@emberian
Copy link
Member

emberian commented Jul 7, 2013

Still relevant

@thestinger
Copy link
Contributor

Triage bump.

@huonw
Copy link
Member

huonw commented Jan 31, 2014

Still there.

@ahmedcharles
Copy link
Contributor

I looked into this, it seems less trivial than I imagined, because the functions don't seem to do the same thing or return the same types (or at least, I don't know enough to recognize the similarities).

@tamird
Copy link
Contributor

tamird commented Apr 26, 2015

There's a whole host of duplication in librustc_resolve/lib.rs, but refactoring it would require lots of closure-passing. I'm not really sure it's appropriate to mark as E-easy :(

bors added a commit that referenced this issue Nov 23, 2015
Replace `TypeNsDef` and `ValueNsDef` with a more general type `NsDef`.

Define a newtype `NameBinding` for `Rc<RefCell<Option<NsDef>>>` and refactor `NameBindings` to be a `NameBinding` for each namespace.

Replace uses of `NameBindings` with `NameBinding` where only one binding is being used (in `NamespaceResult`, `Target,` etc).

Refactor away `resolve_definition_of_name_in_module` and `NameDefinition`, fixing issue #4952.
@nrc
Copy link
Member

nrc commented Nov 24, 2015

Fixed by #29530

@nrc nrc closed this as completed Nov 24, 2015
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 21, 2022
Don't lint various match lints when expanded by a proc-macro

fixes rust-lang#4952

As always for proc-macro output this is a hack-job of a fix. It would be really nice if more proc-macro authors would set spans correctly.

changelog: Don't lint various lints on proc-macro output.
arcnmx pushed a commit to arcnmx/rust that referenced this issue Dec 17, 2022
…ts, r=flodiebold

fix: only shift `BoundVar`s that come from outside lowering context

Fixes rust-lang#13734

There are some free functions `TyLoweringContext` methods call, which do not know anything about current binders in scope. We need to shift in the `BoundVar`s in substitutions that we get from them (rust-lang#4952), but not those we get from `TyLoweringContext` methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

8 participants
@catamorphism @emberian @nrc @huonw @thestinger @tamird @ahmedcharles and others