Skip to content

Commit

Permalink
add a test that exercises at least one of these code paths
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Feb 4, 2023
1 parent 3e81ec2 commit 22bddc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 22bddc8

Please sign in to comment.