mirror of
https://github.com/danog/strum.git
synced 2024-12-02 09:27:57 +01:00
Use rustversion instead of version_check in strum_tests
This commit is contained in:
parent
aeaa19ad86
commit
c8cd49f4e3
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strum_tests"
|
name = "strum_tests"
|
||||||
version = "0.22.0"
|
version = "0.23.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
authors = ["Peter Glotfelty <peglotfe@microsoft.com>"]
|
||||||
|
|
||||||
@ -12,8 +12,5 @@ enum_variant_type = "=0.2.0"
|
|||||||
structopt = "0.2.18"
|
structopt = "0.2.18"
|
||||||
bitflags = "=1.2"
|
bitflags = "=1.2"
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
version_check = "0.9.2"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rustversion = "1.0"
|
rustversion = "1.0"
|
||||||
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
@ -204,8 +204,8 @@ fn from_ref_test_complex() {
|
|||||||
assert_eq!(EnumIntoComplexVars::A, (&EnumIntoComplex::A(&rara)).into());
|
assert_eq!(EnumIntoComplexVars::A, (&EnumIntoComplex::A(&rara)).into());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(try_from)]
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[rustversion::since(1.34)]
|
||||||
#[derive(Debug, Eq, PartialEq, EnumDiscriminants, EnumVariantType)]
|
#[derive(Debug, Eq, PartialEq, EnumDiscriminants, EnumVariantType)]
|
||||||
#[strum_discriminants(
|
#[strum_discriminants(
|
||||||
name(VariantFilterAttrDiscs),
|
name(VariantFilterAttrDiscs),
|
||||||
@ -219,8 +219,8 @@ enum VariantFilterAttr {
|
|||||||
BrightWhite(i32),
|
BrightWhite(i32),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(try_from)]
|
#[rustversion::attr(since(1.34), test)]
|
||||||
#[test]
|
#[rustversion::since(1.34)]
|
||||||
fn filter_variant_attributes_pass_through() {
|
fn filter_variant_attributes_pass_through() {
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
@ -238,8 +238,8 @@ fn filter_variant_attributes_pass_through() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(bare_pub)]
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[rustversion::since(1.34)]
|
||||||
fn override_visibility() {
|
fn override_visibility() {
|
||||||
mod private {
|
mod private {
|
||||||
use super::*;
|
use super::*;
|
||||||
@ -259,8 +259,8 @@ fn override_visibility() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(bare_pub))]
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[rustversion::before(1.34)]
|
||||||
fn override_visibility() {
|
fn override_visibility() {
|
||||||
mod private {
|
mod private {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
Loading…
Reference in New Issue
Block a user