Skip to content

Are floats really dependency free? #29390

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

Closed
xaviershay opened this issue Oct 27, 2015 · 3 comments
Closed

Are floats really dependency free? #29390

xaviershay opened this issue Oct 27, 2015 · 3 comments

Comments

@xaviershay
Copy link
Contributor

As mentioned in http://blog.phil-opp.com/rust-os/setup-rust.html

The core library is added implicitly when using #![no_std] and provides basic standard library features like Option or Iterator. According to the documentation it is “dependency-free”. But it actually has some dependencies, for example on fmod and fmodf.

This strikes me as a bug, either in the core library or in the documentation.

Previously reported at https://github.com/phil-opp/phil-opp.github.io/issues/7, moving here.

@huonw
Copy link
Member

huonw commented Oct 27, 2015

This is a dupe of #27200 (and somewhat related to #27701 and #26449).

Thanks for filing!

@huonw huonw closed this as completed Oct 27, 2015
@alexcrichton
Copy link
Member

In general, however, I don't necessarily consider fmod and fmodf as dependencies of libcore that need to be worried about. Linking with --gc-sections will eliminate them and otherwise you still have to deal with basic dependencies like memcpy and memmove, so having a few small "very well known" functions being unimplemented I think is fine (although they should obviously be minimized where possible).

If we could I'd love to only provide Div/Rem on floats in the standard library, but coherence forces our hand of putting them in libcore, and it's not necessarily the end of the world.

@steveklabnik
Copy link
Member

I'm still not sure that we should describe libcore as 'dependency free' if there are dependencies, though. Shouldn't that be a doc issue?

steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
libcore does have a few deps, like noted in rust-lang#29390

Fixes rust-lang#29502
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
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

No branches or pull requests

4 participants