Skip to content

internal: build per-block ItemTrees #10863

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

Merged
merged 1 commit into from
Nov 26, 2021
Merged

internal: build per-block ItemTrees #10863

merged 1 commit into from
Nov 26, 2021

Conversation

jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Nov 25, 2021

Fixes #7717
Fixes #8911
Fixes #8614

ItemTrees are now flat lists of items, so they should probably be renamed at some point. (not for inline modules)

mod tests {
use super::*;
}
use crate::name;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordered so that the old code path was still hit with the more correct inner item handling.

// Macros can expand to expressions. We return an empty item tree in this case, but
// still need to collect inner items.
ctx.lower_inner_items(e.syntax())
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer request ItemTrees of arbitrary macros (only of macros that can expand to statements), so these cases are gone

@Veykril
Copy link
Member

Veykril commented Nov 26, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 26, 2021

@bors bors bot merged commit 5ea8a9c into rust-lang:master Nov 26, 2021
@jonas-schievink jonas-schievink deleted the per-block-itemtrees branch November 26, 2021 01:08
bors bot added a commit that referenced this pull request Nov 26, 2021
10865: internal: Use the right `ItemTree` when re-resolving attr r=jonas-schievink a=jonas-schievink

Followup to #10863, which caused a panic when analyzing diesel

bors r+

Co-authored-by: Jonas Schievink <[email protected]>
@lnicola
Copy link
Member

lnicola commented Nov 30, 2021

This (or the follow-up PR) reduced the memory usage on self by 32 MB:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants