1
0
mirror of https://github.com/danog/strum.git synced 2024-11-30 04:28:59 +01:00

Use rustversion instead of version_check in strum_tests

This commit is contained in:
Peter Glotfelty 2021-11-16 21:56:51 -08:00
parent aeaa19ad86
commit c8cd49f4e3
3 changed files with 6 additions and 16 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "strum_tests"
version = "0.22.0"
version = "0.23.0"
edition = "2018"
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
@ -12,8 +12,5 @@ enum_variant_type = "=0.2.0"
structopt = "0.2.18"
bitflags = "=1.2"
[build-dependencies]
version_check = "0.9.2"
[dev-dependencies]
rustversion = "1.0"

View File

@ -1,7 +0,0 @@
fn main() {
// Check if version of rustc is >= 1.34
if let Some(true) = version_check::is_min_version("1.34.0") {
println!("cargo:rustc-cfg=try_from");
println!("cargo:rustc-cfg=bare_pub");
}
}

View File

@ -204,8 +204,8 @@ fn from_ref_test_complex() {
assert_eq!(EnumIntoComplexVars::A, (&EnumIntoComplex::A(&rara)).into());
}
#[cfg(try_from)]
#[allow(dead_code)]
#[rustversion::since(1.34)]
#[derive(Debug, Eq, PartialEq, EnumDiscriminants, EnumVariantType)]
#[strum_discriminants(
name(VariantFilterAttrDiscs),
@ -219,8 +219,8 @@ enum VariantFilterAttr {
BrightWhite(i32),
}
#[cfg(try_from)]
#[test]
#[rustversion::attr(since(1.34), test)]
#[rustversion::since(1.34)]
fn filter_variant_attributes_pass_through() {
use std::str::FromStr;
@ -238,8 +238,8 @@ fn filter_variant_attributes_pass_through() {
);
}
#[cfg(bare_pub)]
#[test]
#[rustversion::since(1.34)]
fn override_visibility() {
mod private {
use super::*;
@ -259,8 +259,8 @@ fn override_visibility() {
);
}
#[cfg(not(bare_pub))]
#[test]
#[rustversion::before(1.34)]
fn override_visibility() {
mod private {
use super::*;