-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
avoid clone path prefix when lowering to hir #113847
Conversation
Signed-off-by: SparrowLii <liyuan179@huawei.com>
This looks good to me, but I'd like someone else to confirm that it's fine to have different segments with the same HirIds. |
Thanks! @petrochenkov Could you help to have a look? |
Having multiple nodes with the same HirId is problematic in general. In particular here, that does not happen.
For the first r=me with a comment |
Signed-off-by: SparrowLii <liyuan179@huawei.com>
Thanks much for the explaination! @Aaron1011 Can you help r=cjgillot? I'm not reviewer :) |
Thanks! |
avoid clone path prefix when lowering to hir Found this while trying to parallelize `lower_to_hir`. When lowering to hir, `Nested` paths in `ast` will be split and the prefix segments will be cloned. This could be omited, since the only consequence is that the prefix segments in `Path`s in hir will have the same `HirId`s, and it seems harmless. This simplifies the process of lowering to hir and avoids re-modification of `ResolverAstLowering`. r? `@Aaron1011` cc rust-lang#99292
⌛ Testing commit 0377945 with merge 15e819382021a6e76aaed69abff507eae5788cac... |
💔 Test failed - checks-actions |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c06b2b9): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 649.721s -> 650.093s (0.06%) |
Found this while trying to parallelize
lower_to_hir
.When lowering to hir,
Nested
paths inast
will be split and the prefix segments will be cloned. This could be omited, since the only consequence is that the prefix segments inPath
s in hir will have the sameHirId
s, and it seems harmless.This simplifies the process of lowering to hir and avoids re-modification of
ResolverAstLowering
.r? @Aaron1011
cc #99292