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

Possible to support #[rustc::minimum(1.27)] or the like? #4

Closed
mathstuf opened this issue May 9, 2019 · 2 comments
Closed

Possible to support #[rustc::minimum(1.27)] or the like? #4

mathstuf opened this issue May 9, 2019 · 2 comments

Comments

@mathstuf
Copy link

mathstuf commented May 9, 2019

Using attributes which are always-true or always-false under this would then warn/error about being a tautology. This would help make sure that as the minimum version is bumped, old code/checks go away.

It would also act as documentation for the minimum version allowed. (AFAIK, still waiting on that field in Cargo.toml).

@dtolnay
Copy link
Owner

dtolnay commented May 9, 2019

Seems reasonable. I would accept a PR implementing this.

mathstuf added a commit to mathstuf/select-rustc that referenced this issue May 9, 2019
This allows crates to declare the minimum supported version in their
code. Further use of `#[rustc]` attributes will then error if a
tautology is discovered.

Missing:

  - [ ] documentation updates
  - [ ] error impls/messages
  - [ ] test cases

Fixes: dtolnay#4
@mathstuf
Copy link
Author

Looks like there's a merged RFC for this now, so I'll close this in preference for that.

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

2 participants