Simplify ast::UseTreeKind - #162794
Simplify ast::UseTreeKind#162794nnethercote wants to merge 3 commits into
ast::UseTreeKind#162794Conversation
It makes sense to put the top-level item first, before the use tree within the item. And it makes sense to have a single function-level comment explaining this rather than inline comments at the definition and every call site.
`is_public` is not relevant here.
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease
cc @rust-lang/rustfmt
cc @rust-lang/clippy |
|
LLM disclosure: some of the ideas for these changes came from an LLM. I made all the changes myself. |
|
I can't express why exactly, but I'm not sure I like the idea (the last commit, I mean). I wonder what issues this non-uniqueness of r? @oli-obk what do you think? |
|
Yea it doesn't really feel nice. We'd then want to do this for the HIR, too, I suspect, and there it's def wrong. I think it is sth I'd probably end up reverting or obsoleting anyway depending on how far we can refactor the use trees away from being a normal item (they aren't really, they don't share much of the side tables with the rest of the items) |
Currently a `NodeId` is stored in a pair with each nested use tree. This commit changes the pair to a named type `UseTreeAndId`. In most places this doesn't make much difference but in the AST visitor it gets rid of several weird special cases.
9cc50d5 to
4bfe145
Compare
|
I have changed the final commit to introduce a new type |
We can make things simpler by adjusting how the ids are stored. Details in individual commits.
r? @petrochenkov