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

Automatic alloc detection #95

Merged
merged 2 commits into from
Sep 10, 2020
Merged

Automatic alloc detection #95

merged 2 commits into from
Sep 10, 2020

Conversation

Plecra
Copy link
Contributor

@Plecra Plecra commented Aug 26, 2020

Closes #94

Uses autocfg to detect the availability of the alloc crate, removing the need for a feature. This avoids forcing libraries to proxy the feature through, or awkward extra dependencies on miniz_oxide to force the feature to be enabled.

I don't actually know any way this could break semver. The no_extern_crate_alloc won't use alloc<1.36, but they're all going to be rexported in std anyway. Either way, 0.4.1 is only ~10 days old

@Plecra Plecra changed the title feat: automatic alloc detection Automatic alloc detection Aug 26, 2020

fn main() {
autocfg::new().emit_sysroot_crate("alloc");
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lacking newline

@oyvindln
Copy link
Collaborator

Yeah this would be nice.

@HeroicKatora does this work fine for your needs?

Copy link
Contributor

@HeroicKatora HeroicKatora left a comment

Choose a reason for hiding this comment

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

I believe it should work if the feature is not removed but simply changed into a no-op.

@oyvindln
Copy link
Collaborator

oyvindln commented Sep 5, 2020

Is it fine now @HeroicKatora ?

Copy link
Contributor

@HeroicKatora HeroicKatora left a comment

Choose a reason for hiding this comment

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

Should be good to go. The branch works as a drop-in in png etc.

@oyvindln oyvindln merged commit 0c67dc5 into Frommi:master Sep 10, 2020
mbrubeck added a commit to mbrubeck/zip that referenced this pull request Feb 11, 2021
flate2 was pinned to versions <= 1.0.14 in zip-rs#175, because flate2 updated
to a new version of miniz_oxide which increased its MSRV (zip-rs#170,
Frommi/miniz_oxide#85).

This was fixed in Frommi/miniz_oxide#95, so all published versions of
flate2 can once agoin be built with Rust 1.34.0.
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.

Automatic detection of the alloc crate
3 participants