Skip to content

Use correct dir_path when parsing module from path - #162363

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mu001999-contrib:fix-162080
Sep 9, 2026
Merged

Use correct dir_path when parsing module from path#162363
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mu001999-contrib:fix-162080

Conversation

@mu001999

@mu001999 mu001999 commented Sep 6, 2026

Copy link
Copy Markdown
Member

Fixes #162080

We previously used the incorrect dir_path (which was name, the parent of name/mod.rs, in this case), and then joined it with name/mod.rs again, resulting in name/name/mod.rs.

The first commit adds the regression test and snapshot of current behavior, the second commit fixes it.

r? petrochenkov

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 6, 2026
@mu001999
mu001999 marked this pull request as ready for review September 6, 2026 12:07
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 6, 2026
@@ -0,0 +1,5 @@
//@ ignore-auxiliary

#![allow(unused)]

@petrochenkov petrochenkov Sep 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use some other attribute, or add a comment saying that this attribute is required?
Otherwise any cleanup like "remove unnecessary allows" will remove it accidentally.

View changes since the review

@petrochenkov

Copy link
Copy Markdown
Contributor

r=me with #162363 (comment) addressed.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 8, 2026
@mu001999

mu001999 commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@bors r=petrochenkov rollup

@rust-bors

rust-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ac967d6 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 9, 2026
mu001999 added a commit to mu001999/rust that referenced this pull request Sep 9, 2026
…rochenkov

Use correct `dir_path` when parsing module from path

Fixes rust-lang#162080

We previously used the incorrect `dir_path` (which was `name`, the parent of `name/mod.rs`, in this case), and then joined it with `name/mod.rs` again, resulting in `name/name/mod.rs`.

The first commit adds the regression test and snapshot of current behavior, the second commit fixes it.

r? petrochenkov
rust-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
Rollup of 6 pull requests

Successful merges:

 - #162482 (Make `run-make` testsuite work with other codegen backend than LLVM)
 - #161587 (Avoid invalid suggestion in case of macro expansion without inferrable generic type)
 - #162363 (Use correct `dir_path` when parsing module from path)
 - #162408 (add crashtests [7/N])
 - #162502 (triagebot: Subscribe me to amdgpu changes)
 - #162505 (Revert "fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia")
@rust-bors
rust-bors Bot merged commit a2b84ca into rust-lang:main Sep 9, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 9, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
Rollup merge of #162363 - mu001999-contrib:fix-162080, r=petrochenkov

Use correct `dir_path` when parsing module from path

Fixes #162080

We previously used the incorrect `dir_path` (which was `name`, the parent of `name/mod.rs`, in this case), and then joined it with `name/mod.rs` again, resulting in `name/name/mod.rs`.

The first commit adds the regression test and snapshot of current behavior, the second commit fixes it.

r? petrochenkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False circular module error with #[path], inner attribute, and nested mod.rs

3 participants