-
Notifications
You must be signed in to change notification settings - Fork 34
WIP: rustfix-mode flag
#353
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
Draft
smoelius
wants to merge
4
commits into
oli-obk:main
Choose a base branch
from
smoelius:rustfix-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+327
−28
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
18 changes: 9 additions & 9 deletions
18
tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| //@edition: 2018 | ||
| //@check-pass | ||
| fn main() { | ||
| match 42 { | ||
| 0...1 => {} | ||
| _ => {} | ||
| } | ||
| } | ||
| //@edition: 2018 | ||
| //@check-pass | ||
|
|
||
| fn main() { | ||
| match 42 { | ||
| 0...1 => {} | ||
| _ => {} | ||
| } | ||
| } |
14 changes: 7 additions & 7 deletions
14
tests/integrations/basic-fail/tests/actual_tests_bless/normalization_override.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| //@normalize-stderr-test: "NORMALIZATION_OVERRIDE" -> "SUCCESS" | ||
| // Test that the above normalization will be run after the default normalization set in ui_tests_bless.rs | ||
| fn main() { | ||
| asdf //~ ERROR: cannot find | ||
| } | ||
| //@normalize-stderr-test: "NORMALIZATION_OVERRIDE" -> "SUCCESS" | ||
|
|
||
| // Test that the above normalization will be run after the default normalization set in ui_tests_bless.rs | ||
|
|
||
| fn main() { | ||
| asdf //~ ERROR: cannot find | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Error: tests failed | ||
|
|
||
| Location: | ||
| $DIR/src/lib.rs:LL:CC | ||
| error: test failed, to rerun pass `--test json` | ||
|
|
||
| Caused by: | ||
| process didn't exit successfully: `$DIR/target/ui/0/tests/integrations/basic/debug/deps/json-HASH` (exit status: 1) | ||
| Error: tests failed | ||
|
|
||
| Location: | ||
| $DIR/src/lib.rs:LL:CC | ||
| error: test failed, to rerun pass `--test ui_tests` | ||
|
|
||
| Caused by: | ||
| process didn't exit successfully: `$DIR/target/ui/0/tests/integrations/basic/debug/deps/ui_tests-HASH` (exit status: 1) | ||
| error: 2 targets failed: | ||
| `--test json` | ||
| `--test ui_tests` |
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
10 changes: 10 additions & 0 deletions
10
tests/integrations/basic/tests/actual_tests/rustfix-mode_disabled.fixed
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| //@rustfix-mode: disabled | ||
| #![allow(dead_code)] | ||
|
|
||
| pub static x: u32 = 0; | ||
|
|
||
| mod internal { | ||
| pub static y: u32 = 0; | ||
| } | ||
|
|
||
| fn main() {} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
If you set
rustfixinstead ofrustfix-modethe other rustfix flag (line 158) gets overridden if the flag is set instead of both of the flags getting runThere 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.
Just to be clear, this
rustflixflag?ui_test/src/config.rs
Lines 156 to 158 in 2a32015
Could you point me to where that flag is checked?
Uh oh!
There was an error while loading. Please reload this page.
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.
Flags are automatically handled. I'd need to look it up but likely you can grep for
Box<dyn Flag>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.
I apologize. I am genuinely trying to understand what is going on here. But automatically handled by what?
ui_testor something else?If I grep for
Box, I get 123 hits. Grepping forBox::newreduces that to 54. But is there anything more specific I could look for?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.
Oh lmao sorry. Github ate the generic params because it thought they are HTML. Edited
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.
@oli-obk Can I just confirm that this is how you want/expect
ui_testto work? I'm just asking because I don't think I've seen a.fixedfile with a$HASHannotation before.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.
I think you should use the
$HASHinCargo.stdoutfiles, such as the one you linked.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.
Thanks, @kirtchev-adacore. My question to @oli-obk stands, though.
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.
Well, I like dumping lots of info normally to users, so printing the command somewhere is useful. Not sure the current style is the thing I want long term, but just replacing output hashes with $HASH is what I do whenever it shows up in stdout/stderr.
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.
Thanks for your suggestion, @kirtchev-adacore. I pushed that change. I think there may still be some non-determinism in the ordering of the fields, though. For example, I see this in the diff between the previous version and the one I just pushed:
Regardless, I suspect this is tangential to my real problem: I cannot tell whether the
.fixedfiles are being generated and checked. I wish there was an easy way to make that determination.