about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-11 07:10:27 +0000
committerbors <bors@rust-lang.org>2023-06-11 07:10:27 +0000
commitc3bab96b80d6a55eb43e777f17801eac060e0ac9 (patch)
treeafbf6897d3a15f49f28524154c52b416aed8218c /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
parent68bdf609f37a74547d9fbdf28ed22c10f9bcca45 (diff)
parentd091991491631faab8a13d7c119575d4a9f7316d (diff)
downloadrust-c3bab96b80d6a55eb43e777f17801eac060e0ac9.tar.gz
rust-c3bab96b80d6a55eb43e777f17801eac060e0ac9.zip
Auto merge of #14989 - lowr:fix/nested-macro-in-assoc-item-panic, r=Veykril
fix: derive source scope from syntax node to be transformed

Fixes #14534

When we use `PathTransform` for associated items of a trait, we have been feeding `SemanticsScope` for the trait definition to it as source scope. `PathTransform` uses the source scope to resolve paths in associated items to find which path to transform. In the course of path resolution, the scope is responsible for lowering `ast::MacroType`s (because they can be written within a path) using `AstIdMap` for the scope's `HirFileId`.

The problem here is that when an associated item is generated by a macro, the scope for the trait is different from the scope for that associated item. The former can only resolve the top-level macros within the trait definition but not the macro calls generated by those top-level macros. We need the latter to resolve such nested macros.

This PR makes sure that we pass `SemanticsScope` for each associated item we're applying path transformation to.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions