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^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b611f0dc11929f0e02a076614bbfed6d64eebfd8;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 197356b24..dead2cb3f 100644 --- a/src/cargo/core/compiler/context/mod.rs +++ b/src/cargo/core/compiler/context/mod.rs @@ -259,6 +259,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 fce7f2249..0eac889a3 100644 --- a/tests/testsuite/rename_deps.rs +++ b/tests/testsuite/rename_deps.rs @@ -333,8 +333,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();