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

Should accept values other than string literals as version requirements? #19

Closed
taiki-e opened this issue Aug 25, 2020 · 1 comment
Closed

Comments

@taiki-e
Copy link
Owner

taiki-e commented Aug 25, 2020

const_fn attribute currently only accepts string literals as version requirements, like the current cfg_version does.

#[const_fn("1.36")]
const fn func() { /* ... */ }

Should we accept numeric literals directly, like the original RFC or rustversion crate?

#[const_fn(1.36)]
const fn func() { /* ... */ }
@taiki-e
Copy link
Owner Author

taiki-e commented Mar 28, 2021

Stabilization report of cfg_version (rust-lang/rust#64796 (comment)) says:

Literal-free invocations like version(1.50) do cause errors just as version(foo) does.

Closing -- I prefer to keep the same api as cfg_version.

@taiki-e taiki-e closed this as completed Mar 28, 2021
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

1 participant