Skip to content

#[cfg(version)] ignores invalid version literal #79436

Description

@taiki-e

I tried this code:

#![feature(cfg_version)]

#[cfg(version("aa.0"))]
mod foo {}

I expected to see this happen: error or warning about invalid version literal

Instead, this happened: no error or warning
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3f14787508e791c693ac85bf41973b97

Mentioning @mibac138 who implemented #[cfg(version)] in #71314.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-cfg_version`#![feature(cfg_version)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions