Skip to content
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

Rename CrateDefMap to DefMap #7336

Merged
merged 1 commit into from
Jan 18, 2021
Merged

Rename CrateDefMap to DefMap #7336

merged 1 commit into from
Jan 18, 2021

Conversation

jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Jan 18, 2021

I propose handling local items by computing a DefMap for every block expression, using the regular (early) name resolution algorithm. The result of that will be a DefMap that has a reference to the parent DefMap, which is either the one computed for the containing block expression, or the crate's root DefMap. Name resolution will fall back to a name in the parent DefMap if it cannot be resolved in the inner block.

The DefMaps computed for block expressions will go through a separate query that can be garbage-collected much more aggressively, since these DefMaps should be cheap to compute and are never part of a crate's public API.

The first step towards that is to make CrateDefMap not specific to crates anymore, hence this rename (if this plans sounds reasonable).

cc #7325 and #1165

@matklad
Copy link
Member

matklad commented Jan 18, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 18, 2021

@bors bors bot merged commit 0791c8e into rust-lang:master Jan 18, 2021
@jonas-schievink jonas-schievink deleted the defmap branch January 18, 2021 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants