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

Re-introduce the std feature #30

Merged
merged 7 commits into from
Feb 2, 2018
Merged

Re-introduce the std feature #30

merged 7 commits into from
Feb 2, 2018

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Feb 1, 2018

This is a port of @vks's rust-num/num#296, but without the feature-toggled changes to Float. Now Float and the newer Real are completely dependent on having std enabled. In the future we can consider adding separate more-limited float/real traits that can work without std, like the BaseFloat that was originally proposed in the former PR.

This is a breaking change with a bump to 0.2, since anyone currently using default-features = false will lose functionality. The actual API is otherwise unchanged, so my plan is to employ the "semver trick" -- publishing a new num-traits-0.1 that re-exports everything from 0.2 (with std). Thus all num-traits users should remain compatible even if they mix 0.1 and 0.2.

Closes #16.

vks and others added 6 commits January 31, 2018 15:42
This is a port of @vks's rust-num/num#296, but without the feature-
toggled changes to `Float`.
We don't have implementations for many of the methods in `no_std`.  It's
hostile to external implementors if some trait methods are conditional
on a feature, as that feature could be added by anyone in a dependency
tree.  Instead, let's just live without these traits for now.
@cuviper
Copy link
Member Author

cuviper commented Feb 1, 2018

cc @termoshtt, since you had opened #24 before.

@vks
Copy link
Contributor

vks commented Feb 2, 2018

If I understand this correctly, this is a regression for no_std. Should we also re-introduce the BasicFloat trait instead of just removing the Float trait?

@cuviper
Copy link
Member Author

cuviper commented Feb 2, 2018

@vks, I wouldn't call it a regression. The previous no_std PR was revealed to be a breaking change, so it was yanked and reverted. Thus right now, there isn't any no_std num-traits.

But yes, I've come around that BasicFloat was probably the right way to expose some functionality after all. I'm open to adding that again, but it doesn't have to be part of this initial no_std change. Would you like to send that anew after I merge this one?

@vks
Copy link
Contributor

vks commented Feb 2, 2018

But yes, I've come around that BasicFloat was probably the right way to expose some functionality after all. I'm open to adding that again, but it doesn't have to be part of this initial no_std change. Would you like to send that anew after I merge this one?

With pleasure, but it will be a breaking change if we introduce Float: BasicFloat. (Maybe CoreFloat is actually a better name.)

@cuviper
Copy link
Member Author

cuviper commented Feb 2, 2018

it will be a breaking change if we introduce Float: BasicFloat.

Yes, it needs to be independent, even if we did it right away here. I'm not making any API changes, so I can compatibly re-export everything back to 0.1. The only breaking change is the lost functionality under no_std, which is something one can choose when updating to 0.2.

The CoreFloat name does sound good, as it gives some hint about why this should exist at all.

@vks
Copy link
Contributor

vks commented Feb 2, 2018

Alright, then everything looks good to me!

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 2, 2018

🔒 Permission denied

Existing reviewers: click here to make vks a reviewer

@cuviper
Copy link
Member Author

cuviper commented Feb 2, 2018

bors r=vks

bors bot added a commit that referenced this pull request Feb 2, 2018
30: Re-introduce the std feature r=vks a=cuviper

This is a port of @vks's rust-num/num#296, but without the feature-toggled changes to `Float`.  Now `Float` and the newer `Real` are completely dependent on having `std` enabled.  In the future we can consider adding separate more-limited float/real traits that can work without `std`, like the `BaseFloat` that was originally proposed in the former PR.

This is a breaking change with a bump to 0.2, since anyone currently using `default-features = false` will lose functionality.  The actual API is otherwise unchanged, so my plan is to employ the "semver trick" -- publishing a new num-traits-0.1 that re-exports everything from 0.2 (with `std`).  Thus all `num-traits` users should remain compatible even if they mix 0.1 and 0.2.

Closes #16.
@bors
Copy link
Contributor

bors bot commented Feb 2, 2018

Build succeeded

@bors bors bot merged commit ffa67c8 into rust-num:master Feb 2, 2018
@cuviper cuviper deleted the no_std branch February 8, 2024 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants