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

Implement nightly implementation for Ord #7

Closed
daxpedda opened this issue Oct 31, 2021 · 3 comments · Fixed by #15
Closed

Implement nightly implementation for Ord #7

daxpedda opened this issue Oct 31, 2021 · 3 comments · Fixed by #15

Comments

@daxpedda
Copy link
Collaborator

This is related to #5.

On nightly a safe implementation can be done by using core::intrinsic::discriminant_value. This is unstable, but it can be avoided to use a feature in the top-level crate by using #[internal_unstable].

This is also how std implements PartialOrd and Ord.

Obviously has to be hidden behind a crate feature.

@daxpedda daxpedda mentioned this issue Oct 31, 2021
Closed
12 tasks
@ModProg
Copy link
Owner

ModProg commented Oct 31, 2021

Does this need to be hidden behind a feature, or should we check for nightly?

@daxpedda
Copy link
Collaborator Author

Is it possible to check for nightly? The only thing I know of is this RFC: rust-lang/rust#64796.

@ModProg
Copy link
Owner

ModProg commented Oct 31, 2021

you are correct, probably we should use a feature then, because this does not look very ideal:
https://stackoverflow.com/questions/49247618/check-whether-compiler-is-nightly-at-compile-time

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 a pull request may close this issue.

2 participants