rust-analyzer/crates
bors 5f26438b5d Auto merge of #17650 - ObsidianMinor:fix/17645, r=Veykril
Fix path resolution for child mods of those expanded by `include!`

Child modules wouldn't use the correct candidate paths due to a branch that doesn't seem to be doing what it's intended to do. Removing the branch fixes the problem and all existing test cases pass.

Having no knowledge of how any of this works, I believe this fixes #17645. Using another test that writes the included mod directly into `lib.rs` instead, I found the difference can be traced to the candidate files we use to look up mods. A separate branch for if the file comes from an `include!` macro doesn't take into account the original mod we're contained within:

```rust
None if file_id.macro_file().map_or(false, |it| it.is_include_macro(db.upcast())) => {
    candidate_files.push(format!("{}.rs", name.display(db.upcast())));
    candidate_files.push(format!("{}/mod.rs", name.display(db.upcast())));
}
```

I'm not sure why this branch exists. Tracing the branch back takes us to 3bb9efb but it doesn't say *why* the branch was added. The test case that was added in this commit passes with the branch removed, so I think it's just superfluous at this point.
2024-07-21 06:17:14 +00:00
..
base-db Make LRU opt-in 2024-07-19 18:38:08 +02:00
cfg Use symbol in cfg 2024-07-16 10:41:42 +02:00
flycheck feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
hir Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
hir-def Auto merge of #17650 - ObsidianMinor:fix/17645, r=Veykril 2024-07-21 06:17:14 +00:00
hir-expand Auto merge of #17639 - Veykril:salsa-perf, r=Veykril 2024-07-19 18:45:16 +00:00
hir-ty fix: Panic in debug profile for tuple deconstruct with arity mismatch 2024-07-21 02:37:37 +09:00
ide Keep references in format! when the target is unsized 2024-07-20 08:39:04 +02:00
ide-assists Avoid ref when using format! in compiler 2024-07-19 14:41:59 -04:00
ide-completion Avoid ref when using format! in compiler 2024-07-19 14:41:59 -04:00
ide-db Auto merge of #17639 - Veykril:salsa-perf, r=Veykril 2024-07-19 18:45:16 +00:00
ide-diagnostics fix: Panic in debug profile for tuple deconstruct with arity mismatch 2024-07-21 02:37:37 +09:00
ide-ssr Parse try as a keyword only in edition 2018 and up 2024-07-19 15:43:20 +02:00
intern Support rustc_skip_during_method_dispatch 2024-07-17 11:46:36 +02:00
limit Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
load-cargo Auto merge of #17639 - Veykril:salsa-perf, r=Veykril 2024-07-19 18:45:16 +00:00
mbe Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
parser Add missing dyn parse special cases in 2015 edition 2024-07-20 09:18:40 +02:00
paths Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
proc-macro-api Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
proc-macro-srv Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
proc-macro-srv-cli Abstract proc-macro-srv protocol format 2024-06-30 16:56:30 +02:00
profile Fix stop_watch on linux 2024-07-07 08:40:41 +02:00
project-model Auto merge of #17620 - Veykril:edition-aware-parser, r=Veykril 2024-07-19 14:56:56 +00:00
rust-analyzer Auto merge of #17641 - nyurik:optimize-refs, r=Veykril 2024-07-20 06:40:27 +00:00
salsa Add back equality check that went missing 2024-07-19 20:39:09 +02:00
span Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
stdx Merge from rust-lang/rust 2024-07-11 20:06:05 +03:00
syntax Auto merge of #17641 - nyurik:optimize-refs, r=Veykril 2024-07-20 06:40:27 +00:00
test-fixture Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
test-utils Add f16 and f128 support 2024-07-10 10:43:14 +01:00
text-edit Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
toolchain Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
tt Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
vfs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
vfs-notify Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00