Fix compiler errors: lazy_static - Specify version 1.4.0 in Cargo.lock #5721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following up on issue #5702 in regards to lazy_static failing to compile with newer versions of rust. The issue has been reported in the upstream however the issue hasn't been acknowledged in 4+ months, so it seems clear we can't expect upstream to swiftly resolve this for us. An ideal long term solution would be to phase out lazy_static, but many crates continue to use this crate, meaning we would be required to either phase out those crates as well or wait for them to resolve the issue upstream. Both will take a lot of time.
I have determined that version lazy_static 1.4.0 seems to work on the latest stable version of rust (1.80.0 as of this pr). As a temporary but potentially indefinite solution, I propose re-adding the Cargo.lock file to exclusively include lazy_static 1.4.0. This way, the Cargo.lock file will still be generated per-build for all other crates, but the relevant dependencies will be made to use the version of lazy_static which I have determined to work, which resolves the issue of slint failing to compile.
The only potential consequence I can see from this change is that any new crates that may potentially be added to slint which for some reason would require lazy_static 1.5.0 will reintroduce this compiler error as the Cargo.lock file could automatically update to the newer version. This might not be clear to the developer at the time if they are working on an older Rust version that does not have any issues with lazy_static 1.5.0. However I believe the risk of this to be minimal, and as a temporary solution it's worthwhile until a more permanent solution can be put in place.