-
Notifications
You must be signed in to change notification settings - Fork 901
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
Fix module resolution in inner modules with paths #4194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! The code looks good to me. Could you make the following changes to the test code?
- Move
inner-module-path/
underrustfmt-lib/tests/target/
. - Delete
inner_module_path
. - Add
// rustfmt-recursive: true
to the beginning oflib.rs
. This is equivalent to settingOperationSetting.recursive
totrue
.
I'm sorry for the confusion.
Path attributes with relative paths were previously not treated as relative to the containing file but as relative to the current working directory of rustfmt. The SubModKind enum had a dedicated variant for inner modules with paths. However, the ordinary variant for inner modules also handles the presence of path attributes and treats them correctly. Therefore the fix is to simply remove the dedicated enum variant. Fixes rust-lang#3901 Fixes rust-lang#4076
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you for the update!
The AppVeyor failure seems to be a network issue, merging. |
backported in #4411 |
Path attributes with relative paths were previously not treated as
relative to the containing file but as relative to the current working
directory of rustfmt.
The SubModKind enum had a dedicated variant for inner modules with
paths. However, the ordinary variant for inner modules also handles the
presence of path attributes and treats them correctly. Therefore the fix
is to simply remove the dedicated enum variant.
Fixes #3901
Fixes #4076