Skip to content

nostd: remove left-overs from no_std feature flag #36

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

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

dvdhrm
Copy link
Contributor

@dvdhrm dvdhrm commented Apr 9, 2024

The no_std feature flag has been reworked in the past and is now basically the default. This PR removes some leftovers, fixes several warnings about redundant use-declarations, and updates the documentation.

None of this is critical, so feel free to cherry-pick individual pieces, or let me know how to rework them.

Note that I did not see any rust-version or MSVR annotations, so I could not test this with the base version. But I do not think the preludes changed much, so this should be fine.

unicode-width no longer depends on `std`. This has been updated in
README.md in 96eaa4a, but the introductory comments in `lib.rs` still
show the old information.

Align `lib.rs` with `README.md` and drop reference to the old `no_std`
feature flag.
@Manishearth
Copy link
Member

The regen script also needs to be updated

dvdhrm added 3 commits April 11, 2024 16:26
The package is always compiled as `no_std` and pulls in `std`  and
`test` when compiling tests. Hence:

- The prelude of `core` is available unconditionally, and it includes
  `core::options::Option` and its variants. No need to manually declare
  them.

- The `test` crate is in-scope automatically, so no need to manually
  declare it.
The `std` crate is unconditionally pulled in for test builds, hence we
can rely on it. Drop the redundant guards that check against `no_std`.
The `no_std` feature flag has no effect, anymore (as already documented
in `README.md`). Document this in `Cargo.toml`, but retain it for
backwards compatibility.

Note that for better cross-package composability, an `std` flag would
likely be preferred in the future, over a `no_std` flag. The former
allows multiple packages with different preferences on this feature to
be combined in a single build, while the latter does not.

Hence, suggest that `no_std` as feature flag is a legacy compatibility
flag, and will not be used in the future.
@dvdhrm
Copy link
Contributor Author

dvdhrm commented Apr 11, 2024

Argh! Sorry, missed the script. Now fixed!

Would you mind if I change the script to write to src/generated.rs and then pub use ... it from src/tables.rs? It would avoid placing non-generated content into the script. Not that I care too much, so feel free to reject it.

@Manishearth
Copy link
Member

shrug I don't consider that too important

@Manishearth Manishearth merged commit 7c489c3 into unicode-rs:master Apr 11, 2024
2 checks passed
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