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

no_std support #95

Closed
wants to merge 5 commits into from
Closed

no_std support #95

wants to merge 5 commits into from

Conversation

leo60228
Copy link

This bumps the MSRV to 1.36, since it requires the alloc crate. Closes #94.

@cuviper
Copy link
Member

cuviper commented Aug 16, 2019

See also #92 -- but you did it without a feature, which avoids the breaking change there.

I would still rather be more conservative about MSRV though, since 1.36 is very recent. Maybe instead we can make this conditional on the version, detected from a build script? My own autocfg crate is useful here, or others like rustc_version work too. Then we could be automatically no_std for 1.36 and later, while still keeping older support.

src/map.rs Outdated Show resolved Hide resolved
@leo60228
Copy link
Author

Looks like a dependency of rand increased the MSRV upstream.

@cuviper
Copy link
Member

cuviper commented Aug 16, 2019

Ugh, that's annoying. It may be better for us to commit a safe/compatible Cargo.lock, which we can remove or update in newer CI runs.

@leo60228
Copy link
Author

AutoCfg::probe_path doesn't work for crates, I'm going to try and submit a PR for probe_sysroot_crate/emit_sysroot_crate.

@bluss
Copy link
Member

bluss commented Aug 18, 2019

Looks interesting.

Can this PR formulate the goals and gains that come from this change? The breaking changes and churn require solid motivation. Thanks 🙂

@leo60228
Copy link
Author

@cuviper Wait, no, I just forgot that I switched to Rust 2018 in the initial PR...

@leo60228 leo60228 force-pushed the no-std branch 5 times, most recently from 37fe523 to 344765f Compare August 19, 2019 12:11
@leo60228
Copy link
Author

No idea why the doctests aren't compiling...

//let ac = autocfg::new();
//ac.emit_sysroot_crate("std");
//ac.emit_sysroot_crate("alloc");
autocfg::emit("std");
Copy link
Member

Choose a reason for hiding this comment

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

What does this do? Commit logs don't explain it.

Copy link
Member

Choose a reason for hiding this comment

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

That would blindly emit a std config value. I suppose they were doing that as a stopgap until the commented crate tests were available -- that's now in autocfg 0.1.6.

@bluss
Copy link
Member

bluss commented Sep 6, 2019

Also, there is no reason to require Rust 1.36 for alloc — before Rust 1.36, it should still compile using std.

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.

Make this crate no_std
3 participants