rust/crates
bors 51ac6de6f3 Auto merge of #16277 - roife:fix-issue16276, r=Veykril
Resolve panic in `generate_delegate_methods`

Fixes #16276

This PR addresses two issues:

1. When using `PathTransform`, it searches for the node corresponding to the `path` in the `source_scope` during `make::fn_`. Therefore, we need to perform the transform before `make::fn_` (similar to the problem in issue #15804). Otherwise, even though the tokens are the same, their offsets (i.e., `span`) differ, resulting in the error "Can't find CONST_ARG@xxx."

2. As mentioned in the first point, `PathTransform` searches for the node corresponding to the `path` in the `source_scope`. Thus, when transforming paths, we should update nodes from right to left (i.e., use **reverse of preorder** (right -> left -> root) instead of **postorder** (left -> right -> root)). Reasons are as follows:

    In the red-green tree (rowan), we do not store absolute ranges but instead store the length of each node and dynamically calculate offsets (spans). Therefore, when modifying the left-side node (such as nodes are inserted or deleted), it causes all right-side nodes' spans to change. This, in turn, leads to PathTransform being unable to find nodes with the same paths (due to different spans), resulting in errors.
2024-01-09 15:52:34 +00:00
..
base-db Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
cfg Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
flycheck Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
hir Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
hir-def Auto merge of #16311 - Veykril:rustc-deps, r=Veykril 2024-01-09 09:37:48 +00:00
hir-expand Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
hir-ty Auto merge of #16311 - Veykril:rustc-deps, r=Veykril 2024-01-09 09:37:48 +00:00
ide Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
ide-assists Auto merge of #16277 - roife:fix-issue16276, r=Veykril 2024-01-09 15:52:34 +00:00
ide-completion Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
ide-db Auto merge of #16277 - roife:fix-issue16276, r=Veykril 2024-01-09 15:52:34 +00:00
ide-diagnostics Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
ide-ssr Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
intern Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
limit Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
load-cargo fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
mbe Set the in-rust-tree` feature for all rust-analyzer{-proc-macro-srv} steps 2024-01-04 11:02:20 +01:00
parser Auto merge of #16310 - Veykril:range-access-parse, r=Veykril 2024-01-09 09:49:25 +00:00
paths Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
proc-macro-api Auto merge of #16312 - Veykril:win-proc-macro-srv, r=Veykril 2024-01-09 10:12:57 +00:00
proc-macro-srv Try to fix feature gates 2024-01-09 09:52:58 +02:00
proc-macro-srv-cli Recognize proc macro server unexpectedly exiting and report the exit code 2024-01-09 10:37:26 +01:00
profile Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
project-model fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
rust-analyzer Auto merge of #16319 - Veykril:no-double-load, r=Veykril 2024-01-09 10:24:23 +00:00
sourcegen Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
span Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
stdx Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
syntax Auto merge of #16275 - davidsemakula:ast-path-segments, r=Veykril 2024-01-09 15:41:48 +00:00
test-fixture Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
test-utils Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
text-edit Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
toolchain Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
tt Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
vfs fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
vfs-notify fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00