Skip to content

Commit 06dace2

Browse files
committed
Auto merge of #10669 - oli-obk:@, r=Alexendoo
Update to a compiletest-rs version that requires `//@` for commands Requires Manishearth/compiletest-rs#261 to get published This PR is a smaller step towards #10426 changelog: Move to a version of compiletest-rs that allows us to require `//`@`` for test suite commands.
2 parents 523c8fa + def1705 commit 06dace2

File tree

724 files changed

+945
-1009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

724 files changed

+945
-1009
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tempfile = { version = "3.2", optional = true }
2828
termize = "0.1"
2929

3030
[dev-dependencies]
31-
compiletest_rs = { version = "0.9", features = ["tmp"] }
31+
compiletest_rs = { version = "0.10", features = ["tmp"] }
3232
tester = "0.9"
3333
regex = "1.5"
3434
toml = "0.5"

book/src/development/adding_lints.md

+1-1

clippy_dev/src/update_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ fn gen_deprecated_lints_test(lints: &[DeprecatedLint]) -> String {
741741
fn gen_renamed_lints_test(lints: &[RenamedLint]) -> String {
742742
let mut seen_lints = HashSet::new();
743743
let mut res: String = GENERATED_FILE_COMMENT.into();
744-
res.push_str("// run-rustfix\n\n");
744+
res.push_str("//@run-rustfix\n\n");
745745
for lint in lints {
746746
if seen_lints.insert(&lint.new_name) {
747747
writeln!(res, "#![allow({})]", lint.new_name).unwrap();

clippy_lints/src/methods/obfuscated_if_else.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-rustfix
2-
31
use super::OBFUSCATED_IF_ELSE;
42
use clippy_utils::{diagnostics::span_lint_and_sugg, source::snippet_with_applicability};
53
use rustc_errors::Applicability;

tests/compile-test.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
126126
let mut config = compiletest::Config {
127127
edition: Some("2021".into()),
128128
mode: TestMode::Ui,
129+
strict_headers: true,
129130
..Default::default()
130131
};
131132

@@ -424,7 +425,7 @@ fn check_rustfix_coverage() {
424425
.binary_search_by_key(&filename, Path::new)
425426
.is_ok(),
426427
"`{rs_file}` runs `MachineApplicable` diagnostics but is missing a `run-rustfix` annotation. \
427-
Please either add `// run-rustfix` at the top of the file or add the file to \
428+
Please either add `//@run-rustfix` at the top of the file or add the file to \
428429
`RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS` in `tests/compile-test.rs`.",
429430
);
430431
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=cargo_common_metadata
1+
//@compile-flags: --crate-name=cargo_common_metadata
22
#![warn(clippy::cargo_common_metadata)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=cargo_common_metadata
1+
//@compile-flags: --crate-name=cargo_common_metadata
22
#![warn(clippy::cargo_common_metadata)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=cargo_common_metadata
1+
//@compile-flags: --crate-name=cargo_common_metadata
22
#![warn(clippy::cargo_common_metadata)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=cargo_common_metadata
1+
//@compile-flags: --crate-name=cargo_common_metadata
22
#![warn(clippy::cargo_common_metadata)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=cargo_common_metadata
1+
//@compile-flags: --crate-name=cargo_common_metadata
22
#![warn(clippy::cargo_common_metadata)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=cargo_common_metadata
1+
//@compile-flags: --crate-name=cargo_common_metadata
22
#![warn(clippy::cargo_common_metadata)]
33

44
fn main() {}

tests/ui-cargo/feature_name/fail/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=feature_name
1+
//@compile-flags: --crate-name=feature_name
22
#![warn(clippy::redundant_feature_names)]
33
#![warn(clippy::negative_feature_names)]
44

tests/ui-cargo/feature_name/pass/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=feature_name
1+
//@compile-flags: --crate-name=feature_name
22
#![warn(clippy::redundant_feature_names)]
33
#![warn(clippy::negative_feature_names)]
44

tests/ui-cargo/module_style/fail_mod_remap/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --remap-path-prefix {{src-base}}=/remapped
1+
//@compile-flags: --remap-path-prefix {{src-base}}=/remapped
22

33
#![warn(clippy::self_named_module_files)]
44

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=multiple_crate_versions
1+
//@compile-flags: --crate-name=multiple_crate_versions
22
#![warn(clippy::multiple_crate_versions)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=multiple_crate_versions
1+
//@compile-flags: --crate-name=multiple_crate_versions
22
#![warn(clippy::multiple_crate_versions)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=multiple_crate_versions
1+
//@compile-flags: --crate-name=multiple_crate_versions
22
#![warn(clippy::multiple_crate_versions)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=wildcard_dependencies
1+
//@compile-flags: --crate-name=wildcard_dependencies
22
#![warn(clippy::wildcard_dependencies)]
33

44
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name=wildcard_dependencies
1+
//@compile-flags: --crate-name=wildcard_dependencies
22
#![warn(clippy::wildcard_dependencies)]
33

44
fn main() {}

tests/ui-internal/collapsible_span_lint_calls.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![deny(clippy::internal)]
33
#![allow(clippy::missing_clippy_version_attribute)]
44
#![feature(rustc_private)]

tests/ui-internal/collapsible_span_lint_calls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![deny(clippy::internal)]
33
#![allow(clippy::missing_clippy_version_attribute)]
44
#![feature(rustc_private)]

tests/ui-internal/custom_ice_message.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// rustc-env:RUST_BACKTRACE=0
2-
// normalize-stderr-test: "Clippy version: .*" -> "Clippy version: foo"
3-
// normalize-stderr-test: "produce_ice.rs:\d*:\d*" -> "produce_ice.rs"
4-
// normalize-stderr-test: "', .*clippy_lints" -> "', clippy_lints"
5-
// normalize-stderr-test: "'rustc'" -> "'<unnamed>'"
6-
// normalize-stderr-test: "(?ms)query stack during panic:\n.*end of query stack\n" -> ""
1+
//@rustc-env:RUST_BACKTRACE=0
2+
//@normalize-stderr-test: "Clippy version: .*" -> "Clippy version: foo"
3+
//@normalize-stderr-test: "produce_ice.rs:\d*:\d*" -> "produce_ice.rs"
4+
//@normalize-stderr-test: "', .*clippy_lints" -> "', clippy_lints"
5+
//@normalize-stderr-test: "'rustc'" -> "'<unnamed>'"
6+
//@normalize-stderr-test: "(?ms)query stack during panic:\n.*end of query stack\n" -> ""
77

88
#![deny(clippy::internal)]
99
#![allow(clippy::missing_clippy_version_attribute)]

tests/ui-internal/interning_defined_symbol.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![deny(clippy::internal)]
33
#![allow(clippy::missing_clippy_version_attribute, clippy::let_unit_value)]
44
#![feature(rustc_private)]

tests/ui-internal/interning_defined_symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![deny(clippy::internal)]
33
#![allow(clippy::missing_clippy_version_attribute, clippy::let_unit_value)]
44
#![feature(rustc_private)]

tests/ui-internal/invalid_msrv_attr_impl.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
#![deny(clippy::internal)]
44
#![allow(clippy::missing_clippy_version_attribute)]

tests/ui-internal/invalid_msrv_attr_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
#![deny(clippy::internal)]
44
#![allow(clippy::missing_clippy_version_attribute)]

tests/ui-internal/outer_expn_data.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
#![deny(clippy::internal)]
44
#![allow(clippy::missing_clippy_version_attribute)]

tests/ui-internal/outer_expn_data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
#![deny(clippy::internal)]
44
#![allow(clippy::missing_clippy_version_attribute)]

tests/ui-internal/unnecessary_def_path.fixed

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// run-rustfix
2-
// aux-build:paths.rs
1+
//@run-rustfix
2+
//@aux-build:paths.rs
33
#![deny(clippy::internal)]
44
#![feature(rustc_private)]
55

tests/ui-internal/unnecessary_def_path.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// run-rustfix
2-
// aux-build:paths.rs
1+
//@run-rustfix
2+
//@aux-build:paths.rs
33
#![deny(clippy::internal)]
44
#![feature(rustc_private)]
55

tests/ui-internal/unnecessary_symbol_str.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![feature(rustc_private)]
33
#![deny(clippy::internal)]
44
#![allow(

tests/ui-internal/unnecessary_symbol_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![feature(rustc_private)]
33
#![deny(clippy::internal)]
44
#![allow(

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![warn(clippy::uninlined_format_args)]
33

44
fn main() {

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![warn(clippy::uninlined_format_args)]
33

44
fn main() {

tests/ui-toml/dbg_macro/dbg_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --test
1+
//@compile-flags: --test
22
#![warn(clippy::dbg_macro)]
33

44
fn foo(n: u32) -> u32 {

tests/ui-toml/disallowed_macros/disallowed_macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// aux-build:macros.rs
1+
//@aux-build:macros.rs
22

33
#![allow(unused)]
44

tests/ui-toml/expect_used/expect_used.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --test
1+
//@compile-flags: --test
22
#![warn(clippy::expect_used)]
33

44
fn expect_option() {

tests/ui-toml/mut_key/mut_key.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name mut_key
1+
//@compile-flags: --crate-name mut_key
22

33
#![warn(clippy::mutable_key_type)]
44

tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// compile-flags: --emit=link
2-
// no-prefer-dynamic
1+
//@compile-flags: --emit=link
2+
//@no-prefer-dynamic
33

44
#![crate_type = "proc-macro"]
55

tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.fixed

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// aux-build:proc_macro_derive.rs
2-
// run-rustfix
1+
//@aux-build:proc_macro_derive.rs
2+
//@run-rustfix
33

44
#![warn(clippy::nonstandard_macro_braces)]
55

tests/ui-toml/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// aux-build:proc_macro_derive.rs
2-
// run-rustfix
1+
//@aux-build:proc_macro_derive.rs
2+
//@run-rustfix
33

44
#![warn(clippy::nonstandard_macro_braces)]
55

tests/ui-toml/print_macro/print_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --test
1+
//@compile-flags: --test
22
#![warn(clippy::print_stdout)]
33
#![warn(clippy::print_stderr)]
44

tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-name conf_disallowed_methods
1+
//@compile-flags: --crate-name conf_disallowed_methods
22

33
#![warn(clippy::disallowed_methods)]
44

tests/ui-toml/toml_trivially_copy/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// normalize-stderr-test "\(\d+ byte\)" -> "(N byte)"
2-
// normalize-stderr-test "\(limit: \d+ byte\)" -> "(limit: N byte)"
1+
//@normalize-stderr-test: "\(\d+ byte\)" -> "(N byte)"
2+
//@normalize-stderr-test: "\(limit: \d+ byte\)" -> "(limit: N byte)"
33

44
#![deny(clippy::trivially_copy_pass_by_ref)]
55

Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
//@error-pattern: unknown field `foobar`, expected one of
2+
13
fn main() {}

tests/ui-toml/unwrap_used/unwrap_used.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --test
1+
//@compile-flags: --test
22

33
#![allow(unused_mut, clippy::get_first, clippy::from_iter_instead_of_collect)]
44
#![warn(clippy::unwrap_used)]

tests/ui/allow_attributes.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![allow(unused)]
33
#![warn(clippy::allow_attributes)]
44
#![feature(lint_reasons)]

tests/ui/allow_attributes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![allow(unused)]
33
#![warn(clippy::allow_attributes)]
44
#![feature(lint_reasons)]

tests/ui/almost_complete_range.fixed

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// run-rustfix
2-
// edition:2018
3-
// aux-build:proc_macros.rs
1+
//@run-rustfix
2+
//@edition:2018
3+
//@aux-build:proc_macros.rs
44

55
#![feature(exclusive_range_pattern)]
66
#![feature(stmt_expr_attributes)]

tests/ui/almost_complete_range.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// run-rustfix
2-
// edition:2018
3-
// aux-build:proc_macros.rs
1+
//@run-rustfix
2+
//@edition:2018
3+
//@aux-build:proc_macros.rs
44

55
#![feature(exclusive_range_pattern)]
66
#![feature(stmt_expr_attributes)]

tests/ui/arithmetic_side_effects.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// aux-build:proc_macro_derive.rs
1+
//@aux-build:proc_macro_derive.rs
22

33
#![allow(
44
clippy::assign_op_pattern,

tests/ui/as_conversions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// aux-build:proc_macros.rs
1+
//@aux-build:proc_macros.rs
22

33
#![warn(clippy::as_conversions)]
44
#![allow(clippy::borrow_as_ptr)]

tests/ui/as_underscore.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
#![warn(clippy::as_underscore)]
44

tests/ui/as_underscore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
#![warn(clippy::as_underscore)]
44

tests/ui/asm_syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// only-x86_64
2-
// ignore-aarch64
1+
//@only-x86_64
2+
//@ignore-aarch64
33

44
#[warn(clippy::inline_asm_x86_intel_syntax)]
55
mod warn_intel {

tests/ui/assertions_on_result_states.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![warn(clippy::assertions_on_result_states)]
33

44
use std::result::Result;

tests/ui/assertions_on_result_states.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22
#![warn(clippy::assertions_on_result_states)]
33

44
use std::result::Result;

tests/ui/assign_ops.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-rustfix
1+
//@run-rustfix
22

33
use core::num::Wrapping;
44

0 commit comments

Comments
 (0)