Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ impl<Tx: TransactionWithMeta> Scheduler<Tx> for GreedyScheduler<Tx> {
});
}

#[cfg(debug_assertions)]
debug_assert!(
self.common.batches.is_empty(),
"batches must start empty for scheduling"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl<Tx: TransactionWithMeta> Scheduler<Tx> for PrioGraphScheduler<Tx> {
// Check transactions against filter, remove from container if it fails.
chunked_pops(container, &mut self.prio_graph, &mut window_budget);

#[cfg(debug_assertions)]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this implied by debug_assert???

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I assumed too, but the build error and docs say otherwise. From Rust docs, "The result of expanding debug_assert! is always type checked."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's annoying

Copy link
Copy Markdown

@steviez steviez Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this implied by debug_assert???
...
That's what I assumed too

git blame led me here and same, would not have expected to have to add the extra markup:
https://doc.rust-lang.org/src/core/macros/mod.rs.html#306-312

To clarify, no actions being requested by me, I'm just sharing in your surprise a month late 😆

debug_assert!(
self.common.batches.is_empty(),
"batches must start empty for scheduling"
Expand Down
Loading