Skip to content

Fix MSRV of the macros to actually be 1.46#42

Merged
FSMaxB merged 3 commits intomainfrom
max/fix-msrv
Aug 5, 2025
Merged

Fix MSRV of the macros to actually be 1.46#42
FSMaxB merged 3 commits intomainfrom
max/fix-msrv

Conversation

@FSMaxB
Copy link
Collaborator

@FSMaxB FSMaxB commented Aug 5, 2025

Turns out that panic! is only stable in const contexts starting with Rust 1.57. Initially I was going to introduce a dual MSRV again with 1.57 required for the macros, but then I remembered that there was a trick to get compile time assertions with previous versions of rust.

The code in the macros is far from elegant and doesn't produce great compiler errors, but it does work on 1.46.

This change together with #41 also finally allows running the full tests on our MSRV.

repository = "https://github.com/ruma/js_int"
keywords = ["integer", "no_std"]
categories = ["no-std"]
rust-version = "1.46.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NOTE: This feature wasn't supported in cargo for 1.46, but it still serves as a machine readable way to specify the MSRV, which is why I added it here.

@jplatte
Copy link
Member

jplatte commented Aug 5, 2025

How did you notice the macros didn't work on MSRV?

@FSMaxB
Copy link
Collaborator Author

FSMaxB commented Aug 5, 2025

How did you notice the macros didn't work on MSRV?

cargo +1.46 test --all-features

@FSMaxB
Copy link
Collaborator Author

FSMaxB commented Aug 5, 2025

But now we have the full tests in CI, so it shouldn't happen again.

@jplatte
Copy link
Member

jplatte commented Aug 5, 2025

Okay, so you actually just went to improve CI, this wasn't in a real project?

I'm wondering at which point we should just increase the MSRV ^^

@FSMaxB
Copy link
Collaborator Author

FSMaxB commented Aug 5, 2025

Yeah, not a real project.

I was thinking about ways to come up with a policy for determining the MSRV and the only thing I came up with was looking at some target platforms that ship rustc.

For example looking at Debian versions. Oldstable has 1.48 for example.

@FSMaxB FSMaxB merged commit 05aee0f into main Aug 5, 2025
3 checks passed
@FSMaxB FSMaxB deleted the max/fix-msrv branch August 5, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants