Skip to content

Commit

Permalink
Move arbitrary_enum_discriminant tests to stable
Browse files Browse the repository at this point in the history
The feature stabilised in 1.66.0.
  • Loading branch information
illicitonion committed Dec 31, 2022
1 parent bc957b1 commit 866c4b6
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 67 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ jobs:
command: test
args: --manifest-path=num_enum/Cargo.toml --no-default-features --features=complex-expressions
toolchain: ${{ matrix.toolchain }}
- name: Run tests with std and nightly features
if: matrix.toolchain == 'nightly'
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=num_enum/Cargo.toml --no-default-features --features=std,nightly
toolchain: ${{ matrix.toolchain }}
- name: Build no-std
uses: actions-rs/cargo@v1
with:
Expand Down
1 change: 0 additions & 1 deletion num_enum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ license = "BSD-3-Clause OR MIT OR Apache-2.0"
std = ["num_enum_derive/std"]
complex-expressions = ["num_enum_derive/complex-expressions"]
external_doc = []
nightly = []

default = ["std"] # disable to use in a `no_std` environment

Expand Down
2 changes: 0 additions & 2 deletions num_enum/tests/from_primitive.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg_attr(feature = "nightly", feature(arbitrary_enum_discriminant))]

use ::std::convert::TryFrom;

use ::num_enum::{FromPrimitive, TryFromPrimitive};
Expand Down
2 changes: 0 additions & 2 deletions num_enum/tests/into_primitive.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg_attr(feature = "nightly", feature(arbitrary_enum_discriminant))]

use ::num_enum::IntoPrimitive;

// Guard against https://github.com/illicitonion/num_enum/issues/27
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: Variant with `catch_all` must be a tuple with exactly 1 field matching the repr type
--> tests/try_build/nightly/compile_fail/catch_all_multiple_fields.rs:7:16
--> tests/try_build/compile_fail/catch_all_multiple_fields.rs:5:16
|
7 | #[num_enum(catch_all)]
5 | #[num_enum(catch_all)]
| ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: Variant with `catch_all` must be a tuple with exactly 1 field matching the repr type
--> tests/try_build/nightly/compile_fail/catch_all_non_tuple.rs:7:16
--> tests/try_build/compile_fail/catch_all_non_tuple.rs:5:16
|
7 | #[num_enum(catch_all)]
5 | #[num_enum(catch_all)]
| ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: Variant with `catch_all` must be a tuple with exactly 1 field matching the repr type
--> tests/try_build/nightly/compile_fail/catch_all_type_mismatch.rs:7:16
--> tests/try_build/compile_fail/catch_all_type_mismatch.rs:5:16
|
7 | #[num_enum(catch_all)]
5 | #[num_enum(catch_all)]
| ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `std::default::Default` for type `Number`
--> tests/try_build/nightly/compile_fail/conflicting_default.rs:1:19
--> tests/try_build/compile_fail/conflicting_default.rs:1:19
|
1 | #[derive(Default, num_enum::Default)]
| ------- ^^^^^^^^^^^^^^^^^ conflicting implementation for `Number`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Attribute `catch_all` is mutually exclusive with `default`
--> tests/try_build/compile_fail/default_and_catch_all.rs:6:16
|
6 | #[num_enum(catch_all)]
| ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Attribute `catch_all` is mutually exclusive with `default`
--> tests/try_build/compile_fail/default_and_catch_all_alt.rs:6:16
|
6 | #[num_enum(catch_all)]
| ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Attribute `default` is mutually exclusive with `catch_all`
--> tests/try_build/compile_fail/default_and_catch_all_same_variant.rs:6:5
|
6 | #[default]
| ^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Attribute `default` is mutually exclusive with `catch_all`
--> tests/try_build/compile_fail/default_and_catch_all_same_variant_alt.rs:6:16
|
6 | #[num_enum(default)]
| ^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Multiple variants marked with `#[num_enum(catch_all)]`
--> tests/try_build/compile_fail/multiple_catch_all.rs:6:16
|
6 | #[num_enum(catch_all)]
| ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(arbitrary_enum_discriminant)]

#[derive(Debug, Eq, PartialEq, num_enum::FromPrimitive)]
#[repr(u8)]
enum Enum {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Multiple variants marked with `#[num_enum(catch_all)]`
--> tests/try_build/compile_fail/multiple_catch_all_same_variant.rs:6:16
|
6 | #[num_enum(catch_all)]
| ^^^^^^^^^

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 866c4b6

Please sign in to comment.