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 cargo build error[E0658] #124

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

joaoantoniocardoso
Copy link
Collaborator

@joaoantoniocardoso joaoantoniocardoso commented Aug 30, 2022

enum-iterator is a dependency for vergen, but because v1.2.0 is causing
the error[E0658], we are restricting its version by defining it as ~1.1.3
here.

To give more context, until we've added tracing, vergen v1.1.3 had been chosen
by cargo. With tracing, if we use any version for vergen equal or greater than
v7.0.0, cargo jumps enum-iterator from v0.8.1 to v1.2.0, which will cause an
error when building in the CI:

error[E0658]: use of unstable library feature 'array_from_fn'
   --> /root/.cargo/registry/src/github.com-1285ae84e5963aae/enum-iterator-1.2.0/src/lib.rs:554:18
    |
554 |             Some(core::array::from_fn(|_| unreachable!()))
    |                  ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #89379 <https://github.com/rust-lang/rust/issues/89379> for more information

By adding enum-iterator = "~1.1.3", we are giving v1.1.3 preference
over the latest version (v1.2.0), so the build is fixed.

`enum-iterator` is a dependency for `vergen`, but because `v1.2.0` is causing
the `error[E0658]`, we are restricting its version by defining it as `~1.1.3`
here.

To give more context, until we've added tracing, vergen v1.1.3 had been chosen
by cargo. With tracing, if we use any version for vergen equal or greater than
v7.0.0, cargo jumps enum-iterator from v0.8.1 to v1.2.0, which will cause an
error when building in the CI:

error[E0658]: use of unstable library feature 'array_from_fn'
   --> /root/.cargo/registry/src/github.com-1285ae84e5963aae/enum-iterator-1.2.0/src/lib.rs:554:18
    |
554 |             Some(core::array::from_fn(|_| unreachable!()))
    |                  ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #89379 <rust-lang/rust#89379> for more information

By adding `enum-iterator = "~1.1.3"`, we are giving v1.1.3 preference
over the latest version (v1.2.0), so the build is fixed.
@patrickelectric patrickelectric merged commit cef5990 into mavlink:master Aug 30, 2022
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