Skip to content

Commit

Permalink
Auto merge of #9440 - ehuss:fix-metrics-test, r=Eh2406
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Apr 30, 2021
2 parents 6701e33 + 58ab9c1 commit f3e1322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/util/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f3e1322

Please sign in to comment.