Fixed ICE when formatting files outside of toml dir#6844
Open
aznszn wants to merge 1 commit intorust-lang:mainfrom
Open
Fixed ICE when formatting files outside of toml dir#6844aznszn wants to merge 1 commit intorust-lang:mainfrom
aznszn wants to merge 1 commit intorust-lang:mainfrom
Conversation
5feba42 to
0cb0339
Compare
Contributor
Author
|
i will fix the CI soon |
0cb0339 to
12c3acd
Compare
Contributor
Author
|
@rustbot ready |
Comment on lines
+26
to
+27
| if p.is_absolute() && !p.starts_with(self.ignore_set.path()) { | ||
| false |
Contributor
There was a problem hiding this comment.
If the underlying bug is: someone tried to invoke rustfmt with a --config-path that is outside the tree, then
- Before: we panic
- Now: we silently ignore it, since
is_matchalways returnsfalsehere
I'm wondering if instead we could do one of:
- Print an error to the user, telling them that the config path isn't valid
- Try to make sense of it: is there anything we could reasonably do here? If we're running in
cargo fmtcould we instead use the path toCargo.tomlas the root of ignores?
It doesn't help that --config-path is a bit confusing #5206
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.
Fixes: #6843
The panic was happening due to a line in the ignore crate:
Fix
N.b.: This assumes that rustfmt ignore rules are supposed to be for that directory and below