# HG changeset patch # User Simon Sapin # Date 1621429707 -7200 # Node ID 402bd66cbdf2b97625d168240fe0dd6d46a88520 # Parent 18415fc918a14845f4507b1c8b366d9c67f6b902 rust: Add type annotation to fix inference on Rust Nightly When compiling with Rust Nightly, the im-rs crate silently makes use of the experimental language feature for trait impl specialization. This apperently changes public its APIs in subtle ways such that type inference of some user code can fail where it succeeds when specialization is disabled. This made Mercurial’s Rust unit tests have compilation errors on Nightly. I have not managed to find the exactl root cause, but I wrote down my findings so far at https://github.com/bodil/im-rs/issues/188 This adds type annotation to make unit tests rely less on type inference and work around the issue. Differential Revision: https://phab.mercurial-scm.org/D10742 diff -r 18415fc918a1 -r 402bd66cbdf2 rust/hg-core/src/copy_tracing/tests_support.rs --- a/rust/hg-core/src/copy_tracing/tests_support.rs Wed May 19 13:45:34 2021 +0200 +++ b/rust/hg-core/src/copy_tracing/tests_support.rs Wed May 19 15:08:27 2021 +0200 @@ -123,7 +123,10 @@ ), ) }) - .collect::>() + .collect::, OrdSet) + >>() } }; }