Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation without chrono #111

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

Caellian
Copy link
Contributor

@Caellian Caellian commented Nov 6, 2024

This PR fixes compilation without chrono

Previously cfg!(feature = "chrono") was used which blocks execution at runtime, this was switched out with a #[cfg(feature = "chrono")] block which will block the code at compile time. Blocking it at runtime doesn't work because prevented functions in functions::time don't exist so this causes a compile error.

Added a minimal build to the CI to avoid these kinds of problems in future.

Signed-off-by: Tin Švagelj <[email protected]>
@clarkmcc clarkmcc merged commit 16d7426 into clarkmcc:master Nov 6, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Nov 6, 2024
@alexsnaps
Copy link
Contributor

@Caellian thanks for catching this... cause indeed unlike #[cfg(..., if cfg!(... doesn't remove the code (tho it will get DCE'ed eventually), while they both still evaluate at compile time, so the code guarded here would indeed need to compile, which in this case it can't. I plead guilty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants