Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::{
aux_builds::AuxBuilder, custom_flags::edition::Edition,
custom_flags::revision_args::RustcRevisionArgs, custom_flags::run::Run,
custom_flags::rustfix::RustfixMode, custom_flags::Flag, filter::Match,
custom_flags::rustfix_mode::RustfixMode, custom_flags::Flag, filter::Match,
};
use crate::{
diagnostics::{self, Diagnostics},
Expand Down Expand Up @@ -155,7 +155,7 @@ impl Config {
.add_custom("edition", Edition("2021".into()));
comment_defaults
.base()
.add_custom("rustfix", RustfixMode::MachineApplicable);
.add_custom("rustfix-mode", RustfixMode::MachineApplicable);
let filters = vec![
(Match::PathBackslash, b"/".to_vec()),
#[cfg(windows)]
Expand Down Expand Up @@ -197,7 +197,20 @@ impl Config {
.custom_comments
.insert("no-rustfix", |parser, _args, span| {
// args are ignored (can be used as comment)
parser.set_custom_once("no-rustfix", (), span);
parser.set_custom_once("rustfix-mode", RustfixMode::Disabled, span);
});

config
.custom_comments
.insert("rustfix-mode", |parser, args, span| {
match args.content.parse::<RustfixMode>() {
Ok(mode) => {
parser.set_custom_once("rustfix-mode", mode, span);
Copy link
Owner

Choose a reason for hiding this comment

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

If you set rustfix instead of rustfix-mode the other rustfix flag (line 158) gets overridden if the flag is set instead of both of the flags getting run

Copy link
Contributor Author

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 rustflix flag?

ui_test/src/config.rs

Lines 156 to 158 in 2a32015

comment_defaults
.base()
.add_custom("rustfix", RustfixMode::MachineApplicable);

Could you point me to where that flag is checked?

Copy link
Owner

@oli-obk oli-obk Nov 23, 2025

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>

Copy link
Contributor Author

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

I apologize. I am genuinely trying to understand what is going on here. But automatically handled by what? ui_test or something else?

If I grep for Box, I get 123 hits. Grepping for Box::new reduces that to 54. But is there anything more specific I could look for?

Copy link
Owner

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

Copy link
Contributor Author

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_test to work? I'm just asking because I don't think I've seen a .fixed file with a $HASH annotation before.

Copy link
Contributor

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 $HASH in Cargo.stdout files, such as the one you linked.

Copy link
Contributor Author

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.

Copy link
Owner

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_test to work? I'm just asking because I don't think I've seen a .fixed file with a $HASH annotation before.

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.

Copy link
Contributor Author

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:

Screenshot From 2025-12-02 13-19-16

Regardless, I suspect this is tangential to my real problem: I cannot tell whether the .fixed files are being generated and checked. I wish there was an easy way to make that determination.

}
Err(error) => {
parser.error(args.span(), error.to_string());
}
}
});

config
Expand Down
2 changes: 1 addition & 1 deletion src/custom_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub mod edition;
pub mod revision_args;
#[cfg(feature = "rustc")]
pub mod run;
pub mod rustfix;
pub mod rustfix_mode;

/// Tester-specific flag that gets parsed from `//@` comments.
pub trait Flag: Send + Sync + UnwindSafe + RefUnwindSafe + std::fmt::Debug {
Expand Down
14 changes: 14 additions & 0 deletions src/custom_flags/rustfix.rs → src/custom_flags/rustfix_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ use crate::{
per_test_config::{Comments, Revisioned, TestConfig},
Error, Errored, TestOk,
};
use anyhow::bail;
use rustfix::{CodeFix, Filter, Suggestion};
use spanned::{Span, Spanned};
use std::{
collections::HashSet,
path::{Path, PathBuf},
process::Output,
str::FromStr,
sync::Arc,
};

Expand Down Expand Up @@ -99,6 +101,18 @@ impl Flag for RustfixMode {
}
}

impl FromStr for RustfixMode {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"disabled" => Ok(RustfixMode::Disabled),
"everything" => Ok(RustfixMode::Everything),
"machine-applicable" => Ok(RustfixMode::MachineApplicable),
_ => bail!("unknown `RustfixMode`: {s}"),
}
}
}

fn fix(stderr: &[u8], path: &Path, mode: RustfixMode) -> anyhow::Result<Vec<String>> {
let suggestions = std::str::from_utf8(stderr)
.unwrap()
Expand Down
2 changes: 2 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ fn main() -> Result<()> {
config.filter("RUSTC_ICE=\"0\" ", "");
// The order of the `/deps` directory flag is flaky
config.stdout_filter("/deps", "");
config.stdout_filter("[0-9a-f]+\\.rlib", "$$HASH.rlib");
config.stdout_filter("[0-9a-f]+\\.rmeta", "$$HASH.rmeta");
config.stdout_filter("[0-9a-f]+\\.so", "$$HASH.so");
// Windows backslashes are sometimes escaped.
// Insert the replacement filter at the start to make sure the filter for single backslashes
// runs afterwards.
Expand Down
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 => {}
_ => {}
}
}
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
}
4 changes: 2 additions & 2 deletions tests/integrations/basic-fail/tests/ui_tests_bless.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ui_test::{
custom_flags::rustfix::RustfixMode, dependencies::DependencyBuilder, spanned::Spanned, *,
custom_flags::rustfix_mode::RustfixMode, dependencies::DependencyBuilder, spanned::Spanned, *,
};

fn main() -> ui_test::color_eyre::Result<()> {
Expand Down Expand Up @@ -29,7 +29,7 @@ fn main() -> ui_test::color_eyre::Result<()> {
config
.comment_defaults
.base()
.set_custom("rustfix", rustfix);
.set_custom("rustfix-mode", rustfix);

config
.comment_defaults
Expand Down
19 changes: 19 additions & 0 deletions tests/integrations/basic/Cargo.stderr
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`
127 changes: 125 additions & 2 deletions tests/integrations/basic/Cargo.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
{ "type": "test", "event": "started", "name": "tests/actual_tests/mac_span.rs () - tests/actual_tests/mac_span.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/match_diagnostic_code.rs () - tests/actual_tests/match_diagnostic_code.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/no_rustfix.rs () - tests/actual_tests/no_rustfix.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/rustfix-mode_disabled.rs () - tests/actual_tests/rustfix-mode_disabled.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/rustfix-mode_everything.rs () - tests/actual_tests/rustfix-mode_everything.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/rustfix-mode_invalid.rs () - tests/actual_tests/rustfix-mode_invalid.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/rustfix-mode_machine-applicable.rs () - tests/actual_tests/rustfix-mode_machine-applicable.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/rustfix-multiple.rs () - tests/actual_tests/rustfix-multiple.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/stdin.rs () - tests/actual_tests/stdin.rs" }
{ "type": "test", "event": "started", "name": "tests/actual_tests/unicode.rs () - tests/actual_tests/unicode.rs" }
Expand Down Expand Up @@ -53,6 +57,10 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
{ "type": "test", "event": "ok", "name": "tests/actual_tests/match_diagnostic_code.rs () - tests/actual_tests/match_diagnostic_code.rs" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/match_diagnostic_code.rs () - tests/actual_tests/match_diagnostic_code.fixed" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/no_rustfix.rs () - tests/actual_tests/no_rustfix.rs" }
{ "type": "test", "event": "failed", "name": "tests/actual_tests/rustfix-mode_disabled.rs () - tests/actual_tests/rustfix-mode_disabled.rs", "stdout": "command: <\"rustc\" \"--error-format=json\" \"--out-dir\" \"$DIR/tests/integrations/basic/../../../target/$TMP/0/tests/actual_tests\" \"tests/actual_tests/rustfix-mode_disabled.rs\" \"--extern\" \"quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rlib\" \"--extern\" \"quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rmeta\" \"--extern\" \"serde_derive=$DIR/tests/integrations/basic/../../../target/$TMP/0/debug/libserde_derive-$HASH.so\" \"--extern\" \"basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasic.a\" \"--extern\" \"basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasi$HASH.rlib\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/0/debug\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug\" \"--edition\" \"2021\"> stdout: <warning: static variable `x` should have an upper case name\n --> tests/actual_tests/rustfix-mode_disabled.rs:4:12\n |\n4 | pub static x: u32 = 0;\n | ^ help: convert the identifier to upper case (notice the capitalization): `X`\n |\n = note: `#[warn(non_upper_case_globals)]` on by default\n\nwarning: static variable `y` should have an upper case name\n --> tests/actual_tests/rustfix-mode_disabled.rs:7:16\n |\n7 | pub static y: u32 = 0;\n | ^ help: convert the identifier to upper case (notice the capitalization): `Y`\n\nwarning: 2 warnings emitted\n\n> stderr: <>" }
{ "type": "test", "event": "failed", "name": "tests/actual_tests/rustfix-mode_everything.rs () - tests/actual_tests/rustfix-mode_everything.rs", "stdout": "command: <\"rustc\" \"--error-format=json\" \"--out-dir\" \"$DIR/tests/integrations/basic/../../../target/$TMP/0/tests/actual_tests\" \"tests/actual_tests/rustfix-mode_everything.rs\" \"--extern\" \"quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rlib\" \"--extern\" \"quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rmeta\" \"--extern\" \"serde_derive=$DIR/tests/integrations/basic/../../../target/$TMP/0/debug/libserde_derive-$HASH.so\" \"--extern\" \"basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasic.a\" \"--extern\" \"basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasi$HASH.rlib\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/0/debug\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug\" \"--edition\" \"2021\"> stdout: <warning: static variable `x` should have an upper case name\n --> tests/actual_tests/rustfix-mode_everything.rs:4:12\n |\n4 | pub static x: u32 = 0;\n | ^ help: convert the identifier to upper case (notice the capitalization): `X`\n |\n = note: `#[warn(non_upper_case_globals)]` on by default\n\nwarning: static variable `y` should have an upper case name\n --> tests/actual_tests/rustfix-mode_everything.rs:7:16\n |\n7 | pub static y: u32 = 0;\n | ^ help: convert the identifier to upper case (notice the capitalization): `Y`\n\nwarning: 2 warnings emitted\n\n> stderr: <>" }
{ "type": "test", "event": "failed", "name": "tests/actual_tests/rustfix-mode_invalid.rs () - tests/actual_tests/rustfix-mode_invalid.rs", "stdout": "command: <parse comments> stdout: <> stderr: <>" }
{ "type": "test", "event": "failed", "name": "tests/actual_tests/rustfix-mode_machine-applicable.rs () - tests/actual_tests/rustfix-mode_machine-applicable.rs", "stdout": "command: <\"rustc\" \"--error-format=json\" \"--out-dir\" \"$DIR/tests/integrations/basic/../../../target/$TMP/0/tests/actual_tests\" \"tests/actual_tests/rustfix-mode_machine-applicable.rs\" \"--extern\" \"quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rlib\" \"--extern\" \"quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rmeta\" \"--extern\" \"serde_derive=$DIR/tests/integrations/basic/../../../target/$TMP/0/debug/libserde_derive-$HASH.so\" \"--extern\" \"basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasic.a\" \"--extern\" \"basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasi$HASH.rlib\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/0/debug\" \"-L\" \"$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug\" \"--edition\" \"2021\"> stdout: <warning: static variable `x` should have an upper case name\n --> tests/actual_tests/rustfix-mode_machine-applicable.rs:4:12\n |\n4 | pub static x: u32 = 0;\n | ^ help: convert the identifier to upper case (notice the capitalization): `X`\n |\n = note: `#[warn(non_upper_case_globals)]` on by default\n\nwarning: static variable `y` should have an upper case name\n --> tests/actual_tests/rustfix-mode_machine-applicable.rs:7:16\n |\n7 | pub static y: u32 = 0;\n | ^ help: convert the identifier to upper case (notice the capitalization): `Y`\n\nwarning: 2 warnings emitted\n\n> stderr: <>" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/rustfix-multiple.rs () - tests/actual_tests/rustfix-multiple.rs" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/rustfix-multiple.rs () - tests/actual_tests/rustfix-multiple.1.fixed" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/rustfix-multiple.rs () - tests/actual_tests/rustfix-multiple.2.fixed" }
Expand All @@ -61,7 +69,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
{ "type": "test", "event": "ok", "name": "tests/actual_tests/unicode.rs () - tests/actual_tests/unicode.rs" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/windows_paths.rs () - tests/actual_tests/windows_paths.rs" }
{ "type": "test", "event": "ok", "name": "tests/actual_tests/subdir/aux_proc_macro.rs () - tests/actual_tests/subdir/aux_proc_macro.rs" }
{ "type": "suite", "event": "ok", "passed": 33, "failed": 0, "ignored": 0, "measured": 0, "filtered_out": 0 }
{ "type": "suite", "event": "failed", "passed": 33, "failed": 4, "ignored": 0, "measured": 0, "filtered_out": 0 }

running 3 tests
...
Expand Down Expand Up @@ -96,6 +104,10 @@ tests/actual_tests/mac_span.fixed ... ok
tests/actual_tests/match_diagnostic_code.rs ... ok
tests/actual_tests/match_diagnostic_code.fixed ... ok
tests/actual_tests/no_rustfix.rs ... ok
tests/actual_tests/rustfix-mode_disabled.rs ... FAILED
tests/actual_tests/rustfix-mode_everything.rs ... FAILED
tests/actual_tests/rustfix-mode_invalid.rs ... FAILED
tests/actual_tests/rustfix-mode_machine-applicable.rs ... FAILED
tests/actual_tests/rustfix-multiple.rs ... ok
tests/actual_tests/rustfix-multiple.1.fixed ... ok
tests/actual_tests/rustfix-multiple.2.fixed ... ok
Expand All @@ -105,7 +117,118 @@ tests/actual_tests/unicode.rs ... ok
tests/actual_tests/windows_paths.rs ... ok
tests/actual_tests/subdir/aux_proc_macro.rs ... ok

test result: ok. 33 passed
FAILED TEST: tests/actual_tests/rustfix-mode_disabled.rs
command: "rustc" "--error-format=json" "--out-dir" "$TMP "tests/actual_tests/rustfix-mode_disabled.rs" "--extern" "quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rlib" "--extern" "quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rmeta" "--extern" "serde_derive=$DIR/tests/integrations/basic/../../../target/$TMP/0/debug/libserde_derive-$HASH.so" "--extern" "basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasic.a" "--extern" "basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasi$HASH.rlib" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/0/debug" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug" "--edition" "2021"

error: test got exit status: 0, but expected 1
= note: compilation succeeded, but was expected to fail

error: expected error patterns, but found none

full stderr:
warning: static variable `x` should have an upper case name
--> tests/actual_tests/rustfix-mode_disabled.rs:4:12
|
4 | pub static x: u32 = 0;
| ^ help: convert the identifier to upper case (notice the capitalization): `X`
|
= note: `#[warn(non_upper_case_globals)]` on by default

warning: static variable `y` should have an upper case name
--> tests/actual_tests/rustfix-mode_disabled.rs:7:16
|
7 | pub static y: u32 = 0;
| ^ help: convert the identifier to upper case (notice the capitalization): `Y`

warning: 2 warnings emitted


full stdout:



FAILED TEST: tests/actual_tests/rustfix-mode_everything.rs
command: "rustc" "--error-format=json" "--out-dir" "$TMP "tests/actual_tests/rustfix-mode_everything.rs" "--extern" "quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rlib" "--extern" "quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rmeta" "--extern" "serde_derive=$DIR/tests/integrations/basic/../../../target/$TMP/0/debug/libserde_derive-$HASH.so" "--extern" "basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasic.a" "--extern" "basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasi$HASH.rlib" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/0/debug" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug" "--edition" "2021"

error: test got exit status: 0, but expected 1
= note: compilation succeeded, but was expected to fail

error: expected error patterns, but found none

full stderr:
warning: static variable `x` should have an upper case name
--> tests/actual_tests/rustfix-mode_everything.rs:4:12
|
4 | pub static x: u32 = 0;
| ^ help: convert the identifier to upper case (notice the capitalization): `X`
|
= note: `#[warn(non_upper_case_globals)]` on by default

warning: static variable `y` should have an upper case name
--> tests/actual_tests/rustfix-mode_everything.rs:7:16
|
7 | pub static y: u32 = 0;
| ^ help: convert the identifier to upper case (notice the capitalization): `Y`

warning: 2 warnings emitted


full stdout:



FAILED TEST: tests/actual_tests/rustfix-mode_invalid.rs
command: parse comments

error: unknown `RustfixMode`: invalid
--> tests/actual_tests/rustfix-mode_invalid.rs:1:18
|
1 | //@rustfix-mode: invalid
| ^^^^^^^
|

full stderr:

full stdout:



FAILED TEST: tests/actual_tests/rustfix-mode_machine-applicable.rs
command: "rustc" "--error-format=json" "--out-dir" "$TMP "tests/actual_tests/rustfix-mode_machine-applicable.rs" "--extern" "quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rlib" "--extern" "quote=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libquote-$HASH.rmeta" "--extern" "serde_derive=$DIR/tests/integrations/basic/../../../target/$TMP/0/debug/libserde_derive-$HASH.so" "--extern" "basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasic.a" "--extern" "basic=$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug/libbasi$HASH.rlib" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/0/debug" "-L" "$DIR/tests/integrations/basic/../../../target/$TMP/$TRIPLE/debug" "--edition" "2021"

error: test got exit status: 0, but expected 1
= note: compilation succeeded, but was expected to fail

error: expected error patterns, but found none

full stderr:
warning: static variable `x` should have an upper case name
--> tests/actual_tests/rustfix-mode_machine-applicable.rs:4:12
|
4 | pub static x: u32 = 0;
| ^ help: convert the identifier to upper case (notice the capitalization): `X`
|
= note: `#[warn(non_upper_case_globals)]` on by default

warning: static variable `y` should have an upper case name
--> tests/actual_tests/rustfix-mode_machine-applicable.rs:7:16
|
7 | pub static y: u32 = 0;
| ^ help: convert the identifier to upper case (notice the capitalization): `Y`

warning: 2 warnings emitted


full stdout:


FAILURES:
tests/actual_tests/rustfix-mode_disabled.rs
tests/actual_tests/rustfix-mode_everything.rs
tests/actual_tests/rustfix-mode_invalid.rs
tests/actual_tests/rustfix-mode_machine-applicable.rs

test result: FAIL. 4 failed; 33 passed


running 0 tests
Expand Down
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() {}
Loading
Loading