about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-07-21 06:17:14 +0000
committerbors <bors@rust-lang.org>2024-07-21 06:17:14 +0000
commit449d4c471d85c00ce606cf53f42e26fab28b1ba1 (patch)
treed045bcdbe0f86a0f43c48e3493210ea695e780df /tests/codegen/patchable-function-entry
parentea7f3671c073a65873ece60ff806b374d32d35c1 (diff)
parente43b74a1f6fe7bb32fe6fff9def9e2d3cfeb4b9e (diff)
downloadrust-449d4c471d85c00ce606cf53f42e26fab28b1ba1.tar.gz
rust-449d4c471d85c00ce606cf53f42e26fab28b1ba1.zip
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.
Diffstat (limited to 'tests/codegen/patchable-function-entry')
0 files changed, 0 insertions, 0 deletions