Don't change order of tests and benches for cleaner diff.
authorEric Huss <eric@huss.org>
Fri, 20 Oct 2017 23:59:32 +0000 (16:59 -0700)
committerEric Huss <eric@huss.org>
Fri, 20 Oct 2017 23:59:32 +0000 (16:59 -0700)
src/cargo/ops/cargo_compile.rs

index 2aabb150b49250803e43b2e37800fa61477f08b6..bd89fcc3454d98b29af7f55b0a69f3ce3846a7a9 100644 (file)
@@ -652,14 +652,6 @@ fn generate_targets<'a>(pkg: &'a Package,
                 pkg, bins, "bin", Target::is_bin, profile)?);
             targets.append(&mut propose_indicated_targets(
                 pkg, examples, "example", Target::is_example, profile)?);
-            // If --benches was specified, add all targets that would be
-            // generated by `cargo bench`.
-            let bench_filter = match benches {
-                FilterRule::All => Target::benched,
-                FilterRule::Just(_) => Target::is_bench
-            };
-            targets.append(&mut propose_indicated_targets(
-                pkg, benches, "bench", bench_filter, bench_profile)?);
             // If --tests was specified, add all targets that would be
             // generated by `cargo test`.
             let test_filter = match tests {
@@ -668,6 +660,14 @@ fn generate_targets<'a>(pkg: &'a Package,
             };
             targets.append(&mut propose_indicated_targets(
                 pkg, tests, "test", test_filter, test_profile)?);
+            // If --benches was specified, add all targets that would be
+            // generated by `cargo bench`.
+            let bench_filter = match benches {
+                FilterRule::All => Target::benched,
+                FilterRule::Just(_) => Target::is_bench
+            };
+            targets.append(&mut propose_indicated_targets(
+                pkg, benches, "bench", bench_filter, bench_profile)?);
             targets
         }
     };