about summary refs log tree commit diff
path: root/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-10 17:43:06 +0000
committerbors <bors@rust-lang.org>2024-06-10 17:43:06 +0000
commitc9951900442de1b71c93e855326b232678e73c67 (patch)
tree5b8514f51063355c1f165e63611c9b383bd591bd /tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
parent8fd1b507ea7650a2e2670ebba542d9362e910147 (diff)
parent5aa613747046d9c6b044db354bb84c53cbf9f278 (diff)
downloadrust-c9951900442de1b71c93e855326b232678e73c67.tar.gz
rust-c9951900442de1b71c93e855326b232678e73c67.zip
Auto merge of #17381 - roife:fix-issue-17378, r=Veykril
fix: ensure that the parent of a SourceRoot cannot be itself

fix #17378.

In `FileSetConfig.map`, different roots might be mapped to the same `root_id` due to deduplication in `ProjectFolders::new`:

```rust
// Example from rustup
/Users/roife/code/rustup/target/debug/build/rustup-863a063426b56c51/out
/Users/roife/code/rustup
```

In `source_root_parent_map`, r-a might encounter paths where their SourceRootId (i.e. `root_id`) is identical, yet one the them is the parent of the another. This situation can cause the `root_id` to be its own parent, potentially leading to an infinite loop.

This PR resolves such cases by adding a check.
Diffstat (limited to 'tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs')
0 files changed, 0 insertions, 0 deletions