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 unexpected-cfgs lint detected since Rust 1.80 #164

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MarijnS95
Copy link
Member

Rust 1.80 from July 25th 2024 points out that armv7 is not a known, valid value for the target_arch cfg variable. This is confirmed by the docs not listing it either: https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch.

Hence drop this entirely, and rely purely on target_arch = "arm".

Furthermore it also points out that we don't have a test and api-level-30 feature: remove the unused test feature and reexpose ConfigurationRef::screen_round() which was behind a previously unsettable feature = "api-level-30".

[Rust 1.80 from July 25th 2024] points out that `armv7` is not a known,
valid value for the `target_arch` cfg variable.  This is confirmed by
the docs not listing it either:
https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch

Hence drop this entirely, and rely purely on `target_arch = "arm"`.

[Rust 1.80 from July 25th 2024]: https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html
…test`

Some code copied from the NDK carried over the respective `feature`
`cfg` guards, without ever adding the feature to the `[features]` list
in `Cargo.toml`.  Now that Rust detects these mishaps, we can fix it
by removing `test` (bindings don't seem to be run-tested) and reexpose
`ConfigurationRef::screen_round()` which was behind a previously
unsettable `feature = "api-level-30"`.

Also remove `unsafe impl Send/Sync for ConfigurationRef` since the
upstream `ndk` already declares `Configuration` to be `Send` and `Sync`,
and `RwLock` and `Arc` carry that through.
Copy link
Collaborator

@rib rib left a comment

Choose a reason for hiding this comment

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

Thanks, this all looks good to me!

…ndSync` and unwritten `redraw_needed` field
@MarijnS95
Copy link
Member Author

@rib how do we want to deal with this for our MSRV:

error: package `num_enum v0.7.3` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.69.0
Either upgrade to rustc 1.70.0 or newer, or use
cargo update -p [email protected] --precise ver
where `ver` is the latest version of `num_enum` supporting rustc 1.69.0

Shall we run a cargo +nightly generate-lockfile -Zminimal-versions before running the MSRV check?

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.

2 participants