Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly sure that this line is needed, since the hermit
std
library (in the rust compiler) depends on the hermit-abi crate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just removes the
cfg_attr
so that this crate is alwaysno_std
, so things should still work correctly with it being a dep of libstd.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK as of now, it is still necessary to have
rustc-dep-of-std
in dependencies ofstd
library crates.There is a plan to remove it (rust-lang/wg-cargo-std-aware#51), but the issue is still open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, and that feature isn't removed by this PR.
EDIT: All this PR does is remove the gating of
no_std
based on therustc-dep-of-std
feature. Right now, this crate requiresstd
unless therustc-dep-of-std
feature is enabled, in which casestd
is not required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A sorry, I got confused there for a moment. Thanks for the clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example,
libc
(which is also a dependency ofstd
) is just unconditionallyno_std
, see: https://github.com/rust-lang/libc/blob/715b50e1555a339d4e474ac4f6ae5a944bc1b180/src/lib.rs#L28There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current network support depends on
std
.libstd
doesn't select this feature. But we should make sure that this is not enabled ifstd
is not enabled.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that support is in a different crate, this crate (
hermit-abi
) is just a facade crate that doesn't depend on any std code or types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix with another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my mistake. I mixed up
hermit-sys
andhermit-abi
. :-)