From 22bddc810cfc75665e981e82b40d5a0420c0bf41 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 4 Feb 2023 19:44:12 +0100 Subject: [PATCH] add a test that exercises at least one of these code paths --- ci/miri.sh | 2 +- src/set.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/miri.sh b/ci/miri.sh index 78600a4513..8ea3e52db0 100644 --- a/ci/miri.sh +++ b/ci/miri.sh @@ -9,4 +9,4 @@ rustup toolchain install nightly --component miri rustup override set nightly cargo miri setup -MIRIFLAGS='-Zmiri-strict-provenance' cargo miri test +MIRIFLAGS='-Zmiri-strict-provenance' cargo miri test --features nightly diff --git a/src/set.rs b/src/set.rs index a8f24de80b..c0ba27833c 100644 --- a/src/set.rs +++ b/src/set.rs @@ -2886,4 +2886,11 @@ mod test_set { set.insert(i); } } + + #[test] + fn collect() { + // At the time of writing, this hits the ZST case in from_base_index + // (and without the `map`, it does not). + let mut _set: HashSet<_> = (0..3).map(|_| ()).collect(); + } }