Skip to content

Commit 8b99d23

Browse files
authored
Fix trybuilds (#179)
1 parent 6603c83 commit 8b99d23

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0119]: conflicting implementations of trait `num_enum::CannotDeriveBothFromPrimitiveAndTryFromPrimitive` for type `Numbers`
2+
--> tests/try_build/compile_fail/conflicting_derive.rs:1:35
3+
|
4+
1 | #[derive(num_enum::FromPrimitive, num_enum::TryFromPrimitive)]
5+
| ----------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Numbers`
6+
| |
7+
| first implementation here
8+
|
9+
= note: this error originates in the derive macro `num_enum::TryFromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info)
10+
11+
error[E0119]: conflicting implementations of trait `TryFrom<u8>` for type `Numbers`
12+
--> tests/try_build/compile_fail/conflicting_derive.rs:1:35
13+
|
14+
1 | #[derive(num_enum::FromPrimitive, num_enum::TryFromPrimitive)]
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
|
17+
= note: conflicting implementation in crate `core`:
18+
- impl<T, U> TryFrom<U> for T
19+
where U: Into<T>;
20+
= note: this error originates in the derive macro `num_enum::TryFromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info)

num_enum/tests/try_build/compile_fail/custom_error_type_parsing.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ error: expected `name` or `constructor`
1919
error: num_enum attribute must have at most one error_type
2020
--> tests/try_build/compile_fail/custom_error_type_parsing.rs:29:76
2121
|
22-
29 | #[num_enum(error_type(name = CustomError, constructor = CustomError::new), error_type(name = CustomError, constructor = CustomError::new))]
22+
29 | #[num_enum(error_type(name = CustomError, constructor = CustomError::new), error_type(name = CustomError, constructor = CustomError:...
2323
| ^^^^^^^^^^
2424

2525
error: num_enum attribute must have at most one error_type

0 commit comments

Comments
 (0)