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

rustversion::before(date) matches stable version #26

Open
glandium opened this issue Mar 28, 2021 · 1 comment
Open

rustversion::before(date) matches stable version #26

glandium opened this issue Mar 28, 2021 · 1 comment

Comments

@glandium
Copy link

Building the following:

#[rustversion::before(2020-01-01)]
fn main() {
    println!("Hello, world!");
}

fails as expected with recent nightlies (because of the missing main function in that case) but compiles just fine with 1.51.0.

since() is limited to nightlies. It seems before() should too.

@wmmc88
Copy link

wmmc88 commented Dec 22, 2023

I think this is because #[rustversion::before(...) is defined as "Negative of #[rustversion::since(...)].", and #[rustversion::since(<some-nightly-version>)] is defined as "True on that nightly and all newer ones". That would mean that even newer stables than that nightly would not match.

If this is an intentional design decision by @dtolnay, what you want seems to be achieved by #[rustversion::all(nightly, before(2020-01-01))]

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