-
Notifications
You must be signed in to change notification settings - Fork 13
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
Clarify minimal support rust version #83
Comments
Hi @WorldSEnder, Thanks a lot for letting me know! I had forgotten about the badge in the README! Let me clean that up ASAP... Testing with different versions of Rust shows that let punctuation: &[char] = &['.', '!', '?']; I'm not sure why, but when I compare the 1.56.1 I'll fix this and push out a new release! |
Something changed between Rust 1.57 and 1.58 so that the slice pattern doesn’t work without an explicit type annotation in the earlier version. Without it, we get ``` error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 3]` --> src/lib.rs:350:52 | 350 | let mut needs_cap = sentence.ends_with(punctuation); | ^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 3]` | = help: the trait `Fn<(char,)>` is not implemented for `[char; 3]` = note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 3]` = note: required because of the requirements on the impl of `Pattern<'_>` for `&[char; 3]` ``` Between 1.57 and 1.58, the `Pattern` trait got a new implementation for `[char; N]`, and I guess this somehow made the code work afterwards (even though we’re using a `[char]` here). The problematic code change was introduced in #75. Fixes #83.
Back in 2020, I gave up on trying to keep the library compatible with old Rust releases. This was with the 0.7.0 release which gave up compatibility with Rust 1.31 (the first version of the 2018 edition). Since then, the releases have roughly tracked the latest stable release of Rust, with no particular urgency to bump this of course. This is related to #83 where @WorldSEnder noticed that Lipsum no longer compiles on Rust 1.56. This was easy to fix (#84), but we should still remove the misleading badge.
Back in 2020, I gave up on trying to keep the library compatible with old Rust releases. This was with the 0.7.0 release which gave up compatibility with Rust 1.31 (the first version of the 2018 edition). Since then, the releases have roughly tracked the latest stable release of Rust, with no particular urgency to bump this of course. This is related to #83 where @WorldSEnder noticed that Lipsum no longer compiles on Rust 1.56. This was easy to fix (#84), but we should still remove the misleading badge.
Something changed between Rust 1.57 and 1.58 so that the slice pattern doesn’t work without an explicit type annotation in the earlier version. Without it, we get ``` error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 3]` --> src/lib.rs:350:52 | 350 | let mut needs_cap = sentence.ends_with(punctuation); | ^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 3]` | = help: the trait `Fn<(char,)>` is not implemented for `[char; 3]` = note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 3]` = note: required because of the requirements on the impl of `Pattern<'_>` for `&[char; 3]` ``` Between 1.57 and 1.58, the `Pattern` trait got a new implementation for `[char; N]`, and I guess this somehow made the code work afterwards (even though we’re using a `[char]` here). The problematic code change was introduced in #75. Fixes #83.
The newly released 0.8.2 version makes the library build again on 1.56.0. I realized that I never actually answered your question about the minimum supported version: back in 2020, I stopped trying to make So, I've been tracking the latest stable Rust release since — with no hurry to push up the required version, of course. I would be happy to try again with the 2021 edition, perhaps the Rust community have slowed down a bit so that this is feasible now. I'll try with #90 which adds Rust 1.56 to CI and then we can see how it goes. |
That sounds great, thanks for the effort 👍 |
This is the first version to support the 2021 edition. I tried tracking the minimum supported Rust version (MSRV) back in 2020, but this turned out to be infeasible because of frequent bumps to the MSRV in our dependencies (see 9d622cc). I hope the update pace has cooled enough to make the feasible again. I plan to (conservatively) bump this version up as needed going forward. This will of course announcing it in the release notes of new releases. See #83 for the motivation.
The recent update to 0.8.1 breaks when compiling with rust 1.56:
I'm not certain what's the underlying cause for this change (the repo is still tagged with rust 1.31, but reading #77 leads me to believe the tag is outdated). Most likely cause to me is this commit: 72c48a1
In any case, edition 2021 is part of 1.56.0 so at least that part shouldn't be an issue. Can you clarify the minimal supported compiler version, thanks :)
Breaking downstream CI: https://github.com/yewstack/yew/runs/6649247160?check_suite_focus=true#step:5:24
The text was updated successfully, but these errors were encountered: