diff --git a/CHANGELOG.md b/CHANGELOG.md index ff5a52ca..9d97b9bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +### Removed + +## [0.26.4] - 2024-09-08 + +### Added + +### Fixed + +* custom flags were not overriding the default, but the other way around. + +### Changed + * Made more code public for miri to use * Replaced `lazy_static` with std's `OnceLock` diff --git a/Cargo.lock b/Cargo.lock index 118e12e5..029cb8fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 2a49de93..980ced71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ui_test" -version = "0.26.3" +version = "0.26.4" edition = "2021" license = "MIT OR Apache-2.0" description = "A test framework for testing rustc diagnostics output" diff --git a/src/parser.rs b/src/parser.rs index 99bba4cc..26e3d7be 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -453,7 +453,7 @@ impl CommentParser { } for (k, v) in base.custom { - custom.entry(k).or_insert(v); + custom.insert(k, v); } *self.base() = defaults; diff --git a/tests/integrations/basic-bin/Cargo.lock b/tests/integrations/basic-bin/Cargo.lock index 3d7d75c7..51ae75e7 100644 --- a/tests/integrations/basic-bin/Cargo.lock +++ b/tests/integrations/basic-bin/Cargo.lock @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/tests/integrations/basic-fail-mode/Cargo.lock b/tests/integrations/basic-fail-mode/Cargo.lock index 806d3727..04ef877b 100644 --- a/tests/integrations/basic-fail-mode/Cargo.lock +++ b/tests/integrations/basic-fail-mode/Cargo.lock @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/tests/integrations/basic-fail/Cargo.lock b/tests/integrations/basic-fail/Cargo.lock index 1aacb5fe..189d9210 100644 --- a/tests/integrations/basic-fail/Cargo.lock +++ b/tests/integrations/basic-fail/Cargo.lock @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/tests/integrations/basic-fail/Cargo.stdout b/tests/integrations/basic-fail/Cargo.stdout index 945ec6dd..c236b8b8 100644 --- a/tests/integrations/basic-fail/Cargo.stdout +++ b/tests/integrations/basic-fail/Cargo.stdout @@ -463,6 +463,7 @@ Building aux file tests/actual_tests_bless/auxiliary/the_proc_macro.rs ... ok tests/actual_tests_bless/aux_proc_macro_no_main.rs ... FAILED tests/actual_tests_bless/compile_flags_quotes.rs ... FAILED tests/actual_tests_bless/compiletest-rs-command.rs ... FAILED +tests/actual_tests_bless/edition_override.rs ... FAILED tests/actual_tests_bless/failing_executable.rs ... ok tests/actual_tests_bless/failing_executable.rs (revision `run`) ... FAILED Building aux file tests/actual_tests_bless/auxiliary/foomp.rs ... ok @@ -632,6 +633,39 @@ full stdout: +FAILED TEST: tests/actual_tests_bless/edition_override.rs +command: "rustc" "--error-format=json" "--out-dir" "$TMP "tests/actual_tests_bless/edition_override.rs" "--extern" "basic_fail=$DIR/tests/integrations/basic-fail/../../../target/$TMP/$TRIPLE/debug/libbasic_fail.rlib" "--extern" "basic_fail=$DIR/tests/integrations/basic-fail/../../../target/$TMP/$TRIPLE/debug/libbasic_fail-$HASH.rmeta" "-L" "$DIR/tests/integrations/basic-fail/../../../target/$TMP/$TRIPLE/debug" "-L" "$DIR/tests/integrations/basic-fail/../../../target/$TMP/$TRIPLE/debug" "--edition" "2018" + +error: error pattern found in pass test + --> tests/actual_tests_bless/edition_override.rs:6:32 + | +6 | 0...10 => {} //~ WARN: deprecated + | ^^^^^^^^^^ expected because of this annotation + | + ::: tests/actual_tests_bless/edition_override.rs:2:4 + | +2 | //@check-pass + | ^^^^^^^^^^ expected because of this mode change + | + +full stderr: +warning: `...` range patterns are deprecated + --> tests/actual_tests_bless/edition_override.rs:6:10 + | +6 | 0...10 => {} + | ^^^ help: use `..=` for an inclusive range + | + = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! + = note: for more information, see + = note: `#[warn(ellipsis_inclusive_range_patterns)]` on by default + +warning: 1 warning emitted + + +full stdout: + + + FAILED TEST: tests/actual_tests_bless/failing_executable.rs (revision `run`) command: "$CMD" @@ -1061,6 +1095,7 @@ FAILURES: tests/actual_tests_bless/aux_proc_macro_no_main.rs tests/actual_tests_bless/compile_flags_quotes.rs tests/actual_tests_bless/compiletest-rs-command.rs + tests/actual_tests_bless/edition_override.rs tests/actual_tests_bless/failing_executable.rs (revision run) tests/actual_tests_bless/no_main.rs tests/actual_tests_bless/no_main_manual.rs @@ -1079,7 +1114,7 @@ FAILURES: tests/actual_tests_bless/unknown_revision2.rs tests/actual_tests_bless/wrong_diagnostic_code.rs -test result: FAIL. 23 failed; 25 passed; 3 ignored +test result: FAIL. 24 failed; 25 passed; 3 ignored Building dependencies ... ok tests/actual_tests_bless_yolo/revisions_bad.rs (revision `foo`) ... ok diff --git a/tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.rs b/tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.rs new file mode 100644 index 00000000..6be60174 --- /dev/null +++ b/tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.rs @@ -0,0 +1,9 @@ +//@edition:2018 +//@check-pass + +fn main() { + match 42 { + 0...10 => {} //~ WARN: deprecated + _ => {} + } +} diff --git a/tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.stderr b/tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.stderr new file mode 100644 index 00000000..081fa3d6 --- /dev/null +++ b/tests/integrations/basic-fail/tests/actual_tests_bless/edition_override.stderr @@ -0,0 +1,12 @@ +warning: `...` range patterns are deprecated + --> tests/actual_tests_bless/edition_override.rs:6:10 + | +6 | 0...10 => {} + | ^^^ help: use `..=` for an inclusive range + | + = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! + = note: for more information, see + = note: `#[warn(ellipsis_inclusive_range_patterns)]` on by default + +warning: 1 warning emitted + diff --git a/tests/integrations/basic/Cargo.lock b/tests/integrations/basic/Cargo.lock index 1ea5665c..89d3a5de 100644 --- a/tests/integrations/basic/Cargo.lock +++ b/tests/integrations/basic/Cargo.lock @@ -639,7 +639,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/tests/integrations/cargo-run/Cargo.lock b/tests/integrations/cargo-run/Cargo.lock index 3d7d75c7..51ae75e7 100644 --- a/tests/integrations/cargo-run/Cargo.lock +++ b/tests/integrations/cargo-run/Cargo.lock @@ -716,7 +716,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/tests/integrations/dep-fail/Cargo.lock b/tests/integrations/dep-fail/Cargo.lock index 0e7dc0ff..ba44c065 100644 --- a/tests/integrations/dep-fail/Cargo.lock +++ b/tests/integrations/dep-fail/Cargo.lock @@ -565,7 +565,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow", diff --git a/tests/integrations/ui_test_dep_bug/Cargo.lock b/tests/integrations/ui_test_dep_bug/Cargo.lock index 2c989214..2c42a3f0 100644 --- a/tests/integrations/ui_test_dep_bug/Cargo.lock +++ b/tests/integrations/ui_test_dep_bug/Cargo.lock @@ -570,7 +570,7 @@ dependencies = [ [[package]] name = "ui_test" -version = "0.26.3" +version = "0.26.4" dependencies = [ "annotate-snippets", "anyhow",