Fix module resolution in inner modules with paths#4194
Merged
topecongiro merged 1 commit intorust-lang:masterfrom May 22, 2020
Merged
Fix module resolution in inner modules with paths#4194topecongiro merged 1 commit intorust-lang:masterfrom
topecongiro merged 1 commit intorust-lang:masterfrom
Conversation
topecongiro
reviewed
May 22, 2020
Contributor
topecongiro
left a comment
There was a problem hiding this comment.
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: trueto the beginning oflib.rs. This is equivalent to settingOperationSetting.recursivetotrue.
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
Contributor
Author
|
Done |
topecongiro
approved these changes
May 22, 2020
Contributor
topecongiro
left a comment
There was a problem hiding this comment.
Great, thank you for the update!
Contributor
|
The AppVeyor failure seems to be a network issue, merging. |
bradleypmartin
pushed a commit
to bradleypmartin/rustfmt
that referenced
this pull request
May 25, 2020
calebcartwright
pushed a commit
to calebcartwright/rustfmt
that referenced
this pull request
Sep 3, 2020
calebcartwright
pushed a commit
that referenced
this pull request
Sep 5, 2020
Contributor
|
backported in #4411 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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