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

Need a mechanism to write rust-version-specific code #700

Closed
steveklabnik opened this issue Jan 21, 2015 · 1 comment
Closed

Need a mechanism to write rust-version-specific code #700

steveklabnik opened this issue Jan 21, 2015 · 1 comment
Labels
T-lang Relevant to the language team, which will review and decide on the RFC. T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by erickt
Wednesday Oct 17, 2012 at 20:00 GMT

For earlier discussion, see rust-lang/rust#3795

This issue was labelled with: A-attributes, E-easy, I-enhancement, P-low in the Rust repository


Since rust is still going through active development, it's hard to write a library that works for both rust-0.4 and rust-incoming. We need a cfg #[cfg(rust_version="0.5")] to carve off chunks of code that have evolved in between versions.

If we want to get more fancy with these controls, I do have an old semantic version parser I wrote back in the 0.3 days. Maybe we could use something like that to let us write checks like:

#[cfg(rust_version=">=0.4-beta")]
#[cfg(rust_version="<=0.4")]
fn foo() { ... }

#[cfg(rust_version=">0.5")]
fn foo() { ... }
@petrochenkov petrochenkov added T-lang Relevant to the language team, which will review and decide on the RFC. T-libs-api Relevant to the library API team, which will review and decide on the RFC. labels Jan 28, 2018
@Centril
Copy link
Contributor

Centril commented Oct 7, 2018

Closing in favor of #2523.

@Centril Centril closed this as completed Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the RFC. T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants