Auto merge of #9440 - ehuss:fix-metrics-test, r=Eh2406

Fix problem with metrics test.

The `counter_zero_slot` test was checking for an assertion that only fires in a debug build. However, upstream `rust-lang/rust` runs tests in `--release` mode. This unblocks the upstream update.
This commit is contained in:
bors 2021-04-30 21:50:27 +00:00
commit f3e13226d6

View file

@ -12,7 +12,7 @@ pub struct MetricsCounter<const N: usize> {
impl<const N: usize> MetricsCounter<N> {
/// Creates a new counter with an initial value.
pub fn new(init: usize, init_at: Instant) -> Self {
debug_assert!(N > 0, "number of slots must be greater than zero");
assert!(N > 0, "number of slots must be greater than zero");
Self {
slots: [(init, init_at); N],
index: 0,