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

Don't panic if autocfg probe fails #28

Merged
merged 1 commit into from
Jul 29, 2021
Merged

Don't panic if autocfg probe fails #28

merged 1 commit into from
Jul 29, 2021

Conversation

nicholasbishop
Copy link

Motivation: autocfg panics when building with -Zbuild-std.

Instead of panicking when the i128 feature is requested but
probe_type("i128") fails, just go ahead and enable the feature. If
i128 truly isn't available then compilation will still fail, just
later on. This is unlikely to be an issue in practice since i128
was stabilized in Rust 1.26.0
.

Tested by building with:

cargo +nightly build --target=x86_64-unknown-uefi \
    -Zbuild-std=core,alloc --no-default-features \
    --features=i128

I imagine that since the readme lists compatibility starting with rustc 1.31, the i128 feature could probably be dropped entirely, but I figure this more minimal change is easier.

Motivation: [autocfg panics when building with `-Zbuild-std`][1].

Instead of panicking when the `i128` feature is requested but
`probe_type("i128")` fails, just go ahead and enable the feature. If
`i128` truly isn't available then compilation will still fail, just
later on. This is unlikely to be an issue in practice since [`i128`
was stabilized in Rust 1.26.0][2].

Tested by building with:

    cargo +nightly build --target=x86_64-unknown-uefi \
        -Zbuild-std=core,alloc --no-default-features \
        --features=i128

[1]: cuviper/autocfg#34
[2]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1260-2018-05-10
@dignifiedquire dignifiedquire merged commit 56576b5 into dignifiedquire:master Jul 29, 2021
@dignifiedquire
Copy link
Owner

thanks makes sense

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