Skip to content

fix: Fix more path resolution for included submodules #17660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

ObsidianMinor
Copy link
Contributor

Now with more comprehensive testing! This adds tests for includes within modules. Previous testing was not comprehensive enough since submodules that use include! didn't actually work either! The ModDir used for resolving mods relative to included files has to be ModDir::root(). The original test just so happened to put the submodules in the root which made this work, but if you put the include! inside a mod block it didn't work.

With this change, when collecting a macro expansion, if the macro call is an include!, we use the ModDir::root() instead of the current module we're in.

Now with much more comprehensive testing! This
adds tests for includes within modules.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2024
@ObsidianMinor
Copy link
Contributor Author

I probably should've checked this in the previous PR, but this does fix the issues I had before.

From the given include!
image

Before (no inline hints or code completion)
image

After (with type hints and code completion)
image

@Veykril
Copy link
Member

Veykril commented Jul 22, 2024

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jul 22, 2024

📌 Commit cdd7b18 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 22, 2024

⌛ Testing commit cdd7b18 with merge 232e555...

@bors
Copy link
Contributor

bors commented Jul 22, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 232e555 to master...

@bors bors merged commit 232e555 into rust-lang:master Jul 22, 2024
11 checks passed
@ObsidianMinor ObsidianMinor deleted the fix/17645 branch July 22, 2024 11:42
@lnicola lnicola changed the title Fix more path resolution for included submodules fix: Fix more path resolution for included submodules Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants