diff --git a/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr b/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr index e0327b0..fa671a4 100644 --- a/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr +++ b/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::convert::TryFrom` for type `Numbers`: +error[E0119]: conflicting implementations of trait `std::convert::TryFrom` for type `Numbers` --> $DIR/conflicting_derive.rs:1:35 | 1 | #[derive(num_enum::FromPrimitive, num_enum::TryFromPrimitive)] @@ -9,12 +9,12 @@ error[E0119]: conflicting implementations of trait `std::convert::TryFrom` f where U: Into; = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `num_enum::TryFromPrimitive` for type `Numbers`: - --> $DIR/conflicting_derive.rs:1:10 +error[E0119]: conflicting implementations of trait `num_enum::TryFromPrimitive` for type `Numbers` + --> $DIR/conflicting_derive.rs:1:35 | 1 | #[derive(num_enum::FromPrimitive, num_enum::TryFromPrimitive)] - | ^^^^^^^^^^^^^^^^^^^^^^^ -------------------------- first implementation here + | ----------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Numbers` | | - | conflicting implementation for `Numbers` + | first implementation here | = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr_beta b/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr_beta index fa671a4..55a0a23 100644 --- a/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr_beta +++ b/num_enum/tests/try_build/compile_fail/conflicting_derive.stderr_beta @@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `std::convert::TryFrom` f = note: conflicting implementation in crate `core`: - impl TryFrom for T where U: Into; - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `num_enum::TryFromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0119]: conflicting implementations of trait `num_enum::TryFromPrimitive` for type `Numbers` --> $DIR/conflicting_derive.rs:1:35 @@ -17,4 +17,4 @@ error[E0119]: conflicting implementations of trait `num_enum::TryFromPrimitive` | | | first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `num_enum::TryFromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/num_enum/tests/try_build/compile_fail/exhaustive_enum.stderr_beta b/num_enum/tests/try_build/compile_fail/exhaustive_enum.stderr_beta new file mode 100644 index 0000000..6ba5318 --- /dev/null +++ b/num_enum/tests/try_build/compile_fail/exhaustive_enum.stderr_beta @@ -0,0 +1,7 @@ +error: #[derive(FromPrimitive)] requires a variant marked with `#[num_enum(default)]` + --> $DIR/exhaustive_enum.rs:1:10 + | +1 | #[derive(num_enum::FromPrimitive)] + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `num_enum::FromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/num_enum/tests/try_build/compile_fail/missing_default.stderr_beta b/num_enum/tests/try_build/compile_fail/missing_default.stderr_beta new file mode 100644 index 0000000..2c0a3ad --- /dev/null +++ b/num_enum/tests/try_build/compile_fail/missing_default.stderr_beta @@ -0,0 +1,7 @@ +error: #[derive(FromPrimitive)] requires a variant marked with `#[num_enum(default)]` + --> $DIR/missing_default.rs:1:10 + | +1 | #[derive(num_enum::FromPrimitive)] + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `num_enum::FromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/num_enum/tests/try_build/compile_fail/missing_repr.stderr_beta b/num_enum/tests/try_build/compile_fail/missing_repr.stderr_beta new file mode 100644 index 0000000..6b0c81b --- /dev/null +++ b/num_enum/tests/try_build/compile_fail/missing_repr.stderr_beta @@ -0,0 +1,7 @@ +error: Missing `#[repr({Integer})]` attribute + --> $DIR/missing_repr.rs:1:10 + | +1 | #[derive(num_enum::IntoPrimitive)] + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `num_enum::IntoPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/num_enum/tests/try_build/compile_fail/unreachable_patterns.stderr_beta b/num_enum/tests/try_build/compile_fail/unreachable_patterns.stderr_beta new file mode 100644 index 0000000..7c27908 --- /dev/null +++ b/num_enum/tests/try_build/compile_fail/unreachable_patterns.stderr_beta @@ -0,0 +1,12 @@ +error: unreachable pattern + --> $DIR/unreachable_patterns.rs:7:5 + | +7 | Two = 2, + | ^^^ + | +note: the lint level is defined here + --> $DIR/unreachable_patterns.rs:1:10 + | +1 | #[derive(num_enum::TryFromPrimitive)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the derive macro `num_enum::TryFromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info)