Skip to content

Commit af3cfd5

Browse files
committed
fix(test): Un-deprecate contains assertions
1 parent d20216c commit af3cfd5

36 files changed

+0
-106
lines changed

crates/cargo-test-support/src/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,6 @@ impl Execs {
816816
/// - `expected` can end up being ambiguous, causing the assertion to succeed when it should fail
817817
///
818818
/// </div>
819-
#[deprecated(note = "replaced with `Execs::with_stdout_data(expected)`")]
820819
pub fn with_stdout_contains<S: ToString>(&mut self, expected: S) -> &mut Self {
821820
self.expect_stdout_contains.push(expected.to_string());
822821
self
@@ -834,7 +833,6 @@ impl Execs {
834833
/// - `expected` can end up being ambiguous, causing the assertion to succeed when it should fail
835834
///
836835
/// </div>
837-
#[deprecated(note = "replaced with `Execs::with_stderr_data(expected)`")]
838836
pub fn with_stderr_contains<S: ToString>(&mut self, expected: S) -> &mut Self {
839837
self.expect_stderr_contains.push(expected.to_string());
840838
self
@@ -857,7 +855,6 @@ impl Execs {
857855
/// [`Execs::with_stdout_contains`].
858856
///
859857
/// </div>
860-
#[deprecated]
861858
pub fn with_stdout_does_not_contain<S: ToString>(&mut self, expected: S) -> &mut Self {
862859
self.expect_stdout_not_contains.push(expected.to_string());
863860
self
@@ -879,7 +876,6 @@ impl Execs {
879876
/// with [`Execs::with_stderr_line_without`].
880877
///
881878
/// </div>
882-
#[deprecated]
883879
pub fn with_stderr_does_not_contain<S: ToString>(&mut self, expected: S) -> &mut Self {
884880
self.expect_stderr_not_contains.push(expected.to_string());
885881
self
@@ -916,7 +912,6 @@ impl Execs {
916912
/// This will check that a build line includes `-C opt-level=3` but does
917913
/// not contain `-C debuginfo` or `-C incremental`.
918914
///
919-
#[deprecated]
920915
pub fn with_stderr_line_without<S: ToString>(
921916
&mut self,
922917
with: &[S],

tests/testsuite/artifact_dep.rs

-5
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ fn build_script_with_bin_artifact_and_lib_false() {
687687
)
688688
.build();
689689

690-
#[expect(deprecated)]
691690
p.cargo("build -Z bindeps")
692691
.masquerade_as_nightly_cargo(&["bindeps"])
693692
.with_status(101)
@@ -731,7 +730,6 @@ fn lib_with_bin_artifact_and_lib_false() {
731730
)
732731
.build();
733732

734-
#[expect(deprecated)]
735733
p.cargo("build -Z bindeps")
736734
.masquerade_as_nightly_cargo(&["bindeps"])
737735
.with_status(101)
@@ -1117,7 +1115,6 @@ fn build_script_deps_adopt_specified_target_unconditionally() {
11171115
.file("bar/src/lib.rs", "pub fn doit() {}")
11181116
.build();
11191117

1120-
#[expect(deprecated)]
11211118
p.cargo("check -v -Z bindeps")
11221119
.masquerade_as_nightly_cargo(&["bindeps"])
11231120
.with_stderr_does_not_contain(
@@ -1233,7 +1230,6 @@ fn non_build_script_deps_adopt_specified_target_unconditionally() {
12331230
.file("bar/src/lib.rs", "pub fn doit() {}")
12341231
.build();
12351232

1236-
#[expect(deprecated)]
12371233
p.cargo("check -v -Z bindeps")
12381234
.masquerade_as_nightly_cargo(&["bindeps"])
12391235
.with_stderr_contains(
@@ -1378,7 +1374,6 @@ fn build_script_deps_adopts_target_platform_if_target_equals_target() {
13781374
.build();
13791375

13801376
let alternate_target = cross_compile::alternate();
1381-
#[expect(deprecated)]
13821377
p.cargo("check -v -Z bindeps --target")
13831378
.arg(alternate_target)
13841379
.masquerade_as_nightly_cargo(&["bindeps"])

tests/testsuite/build.rs

-6
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ fn cargo_compile_incremental() {
132132
.run();
133133
}
134134

135-
#[expect(deprecated)]
136135
#[cargo_test]
137136
fn incremental_profile() {
138137
let p = project()
@@ -176,7 +175,6 @@ fn incremental_profile() {
176175
.run();
177176
}
178177

179-
#[expect(deprecated)]
180178
#[cargo_test]
181179
fn incremental_config() {
182180
let p = project()
@@ -5180,7 +5178,6 @@ WRAPPER CALLED: rustc --crate-name foo [..]
51805178
.run();
51815179
}
51825180

5183-
#[expect(deprecated)]
51845181
#[cargo_test]
51855182
fn rustc_wrapper_queries() {
51865183
// Check that the invocations querying rustc for information are done with the wrapper.
@@ -5920,7 +5917,6 @@ fn build_filter_infer_profile() {
59205917
.run();
59215918
}
59225919

5923-
#[expect(deprecated)]
59245920
#[cargo_test]
59255921
fn targets_selected_default() {
59265922
let p = project().file("src/main.rs", "fn main() {}").build();
@@ -6874,7 +6870,6 @@ Caused by:
68746870
.run();
68756871
}
68766872

6877-
#[expect(deprecated)]
68786873
#[cargo_test]
68796874
fn build_script_o0_default() {
68806875
let p = project()
@@ -6887,7 +6882,6 @@ fn build_script_o0_default() {
68876882
.run();
68886883
}
68896884

6890-
#[expect(deprecated)]
68916885
#[cargo_test]
68926886
fn build_script_o0_default_even_with_release() {
68936887
let p = project()

tests/testsuite/build_script.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3779,7 +3779,6 @@ fn custom_target_dir() {
37793779
p.cargo("build -v").run();
37803780
}
37813781

3782-
#[expect(deprecated)]
37833782
#[cargo_test]
37843783
fn panic_abort_with_build_scripts() {
37853784
let p = project()

tests/testsuite/build_script_extra_link_arg.rs

-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ the future. For more information, see <https://github.com/rust-lang/cargo/issues
233233
.run();
234234
}
235235

236-
#[expect(deprecated)]
237236
#[cargo_test]
238237
fn link_arg_transitive_not_allowed() {
239238
// Verify that transitive dependencies don't pass link args.

tests/testsuite/cache_messages.rs

-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ WRAPPER CALLED: rustc [..]
527527
.run();
528528
}
529529

530-
#[expect(deprecated)]
531530
#[cargo_test]
532531
fn wacky_hashless_fingerprint() {
533532
// On Windows, executables don't have hashes. This checks for a bad

tests/testsuite/cargo_command.rs

-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ fn list_command_looks_at_path_case_mismatch() {
137137
);
138138
}
139139

140-
#[expect(deprecated)]
141140
#[cargo_test]
142141
fn list_command_handles_known_external_commands() {
143142
let p = project()

tests/testsuite/check.rs

-8
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ fn check_all() {
406406
.run();
407407
}
408408

409-
#[expect(deprecated)]
410409
#[cargo_test]
411410
fn check_all_exclude() {
412411
let p = project()
@@ -433,7 +432,6 @@ fn check_all_exclude() {
433432
.run();
434433
}
435434

436-
#[expect(deprecated)]
437435
#[cargo_test]
438436
fn check_all_exclude_glob() {
439437
let p = project()
@@ -491,7 +489,6 @@ fn check_virtual_all_implied() {
491489
.run();
492490
}
493491

494-
#[expect(deprecated)]
495492
#[cargo_test]
496493
fn check_virtual_manifest_one_project() {
497494
let p = project()
@@ -518,7 +515,6 @@ fn check_virtual_manifest_one_project() {
518515
.run();
519516
}
520517

521-
#[expect(deprecated)]
522518
#[cargo_test]
523519
fn check_virtual_manifest_glob() {
524520
let p = project()
@@ -559,7 +555,6 @@ fn exclude_warns_on_non_existing_package() {
559555
.run();
560556
}
561557

562-
#[expect(deprecated)]
563558
#[cargo_test]
564559
fn targets_selected_default() {
565560
let foo = project()
@@ -633,7 +628,6 @@ error[E0425]: cannot find value `badtext` in this scope
633628
.run();
634629
}
635630

636-
#[expect(deprecated)]
637631
// Verify what is checked with various command-line filters.
638632
#[cargo_test]
639633
fn check_filters() {
@@ -1000,7 +994,6 @@ WRAPPER CALLED: rustc --crate-name foo [..]
1000994
.run();
1001995
}
1002996

1003-
#[expect(deprecated)]
1004997
#[cargo_test]
1005998
fn rustc_workspace_wrapper_respects_primary_units() {
1006999
let p = project()
@@ -1024,7 +1017,6 @@ fn rustc_workspace_wrapper_respects_primary_units() {
10241017
.run();
10251018
}
10261019

1027-
#[expect(deprecated)]
10281020
#[cargo_test]
10291021
fn rustc_workspace_wrapper_excludes_published_deps() {
10301022
let p = project()

tests/testsuite/check_cfg.rs

-22
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ macro_rules! x {
3030
}};
3131
}
3232

33-
#[expect(deprecated)]
3433
#[cargo_test]
3534
fn features() {
3635
let p = project()
@@ -56,7 +55,6 @@ fn features() {
5655
.run();
5756
}
5857

59-
#[expect(deprecated)]
6058
#[cargo_test]
6159
fn features_with_deps() {
6260
let p = project()
@@ -87,7 +85,6 @@ fn features_with_deps() {
8785
.run();
8886
}
8987

90-
#[expect(deprecated)]
9188
#[cargo_test]
9289
fn features_with_opt_deps() {
9390
let p = project()
@@ -119,7 +116,6 @@ fn features_with_opt_deps() {
119116
.run();
120117
}
121118

122-
#[expect(deprecated)]
123119
#[cargo_test]
124120
fn features_with_namespaced_features() {
125121
let p = project()
@@ -150,7 +146,6 @@ fn features_with_namespaced_features() {
150146
.run();
151147
}
152148

153-
#[expect(deprecated)]
154149
#[cargo_test]
155150
fn features_fingerprint() {
156151
let p = project()
@@ -228,7 +223,6 @@ fn features_fingerprint() {
228223
.run();
229224
}
230225

231-
#[expect(deprecated)]
232226
#[cargo_test]
233227
fn well_known_names_values() {
234228
let p = project()
@@ -242,7 +236,6 @@ fn well_known_names_values() {
242236
.run();
243237
}
244238

245-
#[expect(deprecated)]
246239
#[cargo_test]
247240
fn features_test() {
248241
let p = project()
@@ -268,7 +261,6 @@ fn features_test() {
268261
.run();
269262
}
270263

271-
#[expect(deprecated)]
272264
#[cargo_test]
273265
fn features_doctest() {
274266
let p = project()
@@ -297,7 +289,6 @@ fn features_doctest() {
297289
.run();
298290
}
299291

300-
#[expect(deprecated)]
301292
#[cargo_test]
302293
fn well_known_names_values_test() {
303294
let p = project()
@@ -311,7 +302,6 @@ fn well_known_names_values_test() {
311302
.run();
312303
}
313304

314-
#[expect(deprecated)]
315305
#[cargo_test]
316306
fn well_known_names_values_doctest() {
317307
let p = project()
@@ -327,7 +317,6 @@ fn well_known_names_values_doctest() {
327317
.run();
328318
}
329319

330-
#[expect(deprecated)]
331320
#[cargo_test]
332321
fn features_doc() {
333322
let p = project()
@@ -354,7 +343,6 @@ fn features_doc() {
354343
.run();
355344
}
356345

357-
#[expect(deprecated)]
358346
#[cargo_test]
359347
fn build_script_feedback() {
360348
let p = project()
@@ -382,7 +370,6 @@ fn build_script_feedback() {
382370
.run();
383371
}
384372

385-
#[expect(deprecated)]
386373
#[cargo_test]
387374
fn build_script_doc() {
388375
let p = project()
@@ -421,7 +408,6 @@ fn build_script_doc() {
421408
.run();
422409
}
423410

424-
#[expect(deprecated)]
425411
#[cargo_test]
426412
fn build_script_override() {
427413
let target = cargo_test_support::rustc_host();
@@ -531,7 +517,6 @@ test [..] ... ok
531517
.run();
532518
}
533519

534-
#[expect(deprecated)]
535520
#[cargo_test]
536521
fn config_simple() {
537522
let p = project()
@@ -557,7 +542,6 @@ fn config_simple() {
557542
.run();
558543
}
559544

560-
#[expect(deprecated)]
561545
#[cargo_test]
562546
fn config_workspace() {
563547
let p = project()
@@ -599,7 +583,6 @@ fn config_workspace() {
599583
.run();
600584
}
601585

602-
#[expect(deprecated)]
603586
#[cargo_test]
604587
fn config_workspace_not_inherited() {
605588
let p = project()
@@ -631,7 +614,6 @@ fn config_workspace_not_inherited() {
631614
.run();
632615
}
633616

634-
#[expect(deprecated)]
635617
#[cargo_test]
636618
fn config_invalid_position() {
637619
let p = project()
@@ -746,7 +728,6 @@ Caused by:
746728
.run();
747729
}
748730

749-
#[expect(deprecated)]
750731
#[cargo_test]
751732
fn config_and_features() {
752733
let p = project()
@@ -836,7 +817,6 @@ fn config_with_cargo_test() {
836817
.run();
837818
}
838819

839-
#[expect(deprecated)]
840820
#[cargo_test]
841821
fn config_and_build_script() {
842822
let p = project()
@@ -866,7 +846,6 @@ fn config_and_build_script() {
866846
.run();
867847
}
868848

869-
#[expect(deprecated)]
870849
#[cargo_test]
871850
fn config_features_and_build_script() {
872851
let p = project()
@@ -902,7 +881,6 @@ fn config_features_and_build_script() {
902881
.run();
903882
}
904883

905-
#[expect(deprecated)]
906884
#[cargo_test]
907885
fn config_fingerprint() {
908886
let p = project()

0 commit comments

Comments
 (0)