rust-analyzer/crates
bors c86d6230fe 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.
2024-06-10 17:43:06 +00:00
..
base-db chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00
cfg fix: Fix doc comment desugaring for proc-macros 2024-04-27 13:30:51 +02:00
flycheck Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykril 2024-06-03 12:29:27 +00:00
hir Remove extra parse cache from Semantics again 2024-06-10 12:04:35 +02:00
hir-def chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00
hir-expand Don't intern attribute inputs as their spans make them unique 2024-06-09 21:21:33 +02:00
hir-ty Register virtual workspace Cargo.toml files in the VFS 2024-06-09 12:54:50 +02:00
ide Thread more HasSource::source calls through Semantics for caching 2024-06-10 10:33:07 +02:00
ide-assists Thread more HasSource::source calls through Semantics for caching 2024-06-10 10:33:07 +02:00
ide-completion Register virtual workspace Cargo.toml files in the VFS 2024-06-09 12:54:50 +02:00
ide-db Thread more HasSource::source calls through Semantics for caching 2024-06-10 10:33:07 +02:00
ide-diagnostics internal: Expose snippet capability to diagnostic quickfixes 2024-06-07 21:29:48 -04:00
ide-ssr Thread more HasSource::source calls through Semantics for caching 2024-06-10 10:33:07 +02:00
intern Fix new clippy lints 2024-04-01 17:55:56 +02:00
limit Simplify 2024-04-06 13:12:07 +02:00
load-cargo fix: ensure that the parent of a SourceRoot cannot be itself 2024-06-10 23:15:26 +08:00
mbe Cleanup some inert attribute stuff 2024-06-04 12:38:20 +02:00
parser chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00
paths Apply requested changes round 2 2024-06-05 10:45:22 +02:00
proc-macro-api Register virtual workspace Cargo.toml files in the VFS 2024-06-09 12:54:50 +02:00
proc-macro-srv Auto merge of #16257 - lnicola:rustc-check-cfg, r=Veykril 2024-04-18 12:13:06 +00:00
proc-macro-srv-cli Auto merge of #16257 - lnicola:rustc-check-cfg, r=Veykril 2024-04-18 12:13:06 +00:00
profile Fix typos 2024-05-15 18:55:27 +02:00
project-model Register virtual workspace Cargo.toml files in the VFS 2024-06-09 12:54:50 +02:00
rust-analyzer Fix divide by zero 2024-06-09 13:03:01 +02:00
salsa chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00
sourcegen Fix new clippy lints 2024-04-01 17:55:56 +02:00
span style: simplify string interpolation 2024-05-30 16:18:49 -07:00
stdx Track hashes for file contents 2024-05-14 11:21:04 +02:00
syntax chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00
test-fixture style: simplify string interpolation 2024-05-30 16:18:49 -07:00
test-utils style: simplify string interpolation 2024-05-30 16:18:49 -07:00
text-edit Merge commit 'ddf105b646c6749a2de2451c9a499a354eec79c2' into sync-from-ra 2024-02-11 08:40:19 +02:00
toolchain internal: Enforce utf8 paths 2024-03-19 15:39:00 +01:00
tt Cleanup some inert attribute stuff 2024-06-04 12:38:20 +02:00
vfs Register virtual workspace Cargo.toml files in the VFS 2024-06-09 12:54:50 +02:00
vfs-notify discard when the path is invalid utf8 symbol. 2024-04-30 15:39:05 +08:00