From: Eric Huss Date: Sun, 4 Nov 2018 18:38:51 +0000 (-0800) Subject: Fix can_run_doc_tests order depends on hash. X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=99a5a04bff89e0b6b7a523b4f1752407f68c830b;p=cargo.git Fix can_run_doc_tests order depends on hash. The deps are sorted, but the name is the same so the order depends on the metadata hash. Fix by sorting by the actual name, too. Gbp-Pq: Name 1002_fix_doc_tests_order_hash.patch --- diff --git a/src/cargo/core/compiler/context/mod.rs b/src/cargo/core/compiler/context/mod.rs index 225e6ebd5..334a3876a 100644 --- a/src/cargo/core/compiler/context/mod.rs +++ b/src/cargo/core/compiler/context/mod.rs @@ -234,6 +234,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> { } } } + // Help with tests to get a stable order with renamed deps. + doctest_deps.sort(); self.compilation.to_doc_test.push(compilation::Doctest { package: unit.pkg.clone(), target: unit.target.clone(), diff --git a/tests/testsuite/rename_deps.rs b/tests/testsuite/rename_deps.rs index b70c8e824..c8ee06dbc 100644 --- a/tests/testsuite/rename_deps.rs +++ b/tests/testsuite/rename_deps.rs @@ -254,8 +254,8 @@ fn can_run_doc_tests() { [DOCTEST] foo [RUNNING] `rustdoc --test [CWD]/src/lib.rs \ [..] \ - --extern baz=[CWD]/target/debug/deps/libbar-[..].rlib \ --extern bar=[CWD]/target/debug/deps/libbar-[..].rlib \ + --extern baz=[CWD]/target/debug/deps/libbar-[..].rlib \ [..]` ", ).run();