You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "martin-g (via GitHub)" <gi...@apache.org> on 2026/01/08 03:36:52 UTC
[PR] fix: Print the Debug impl of TestError for more info [avro-rs]
martin-g opened a new pull request, #393:
URL: https://github.com/apache/avro-rs/pull/393
Fixes #370
In addition make use of TestResult in two unit tests in schema.rs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671109931
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
Actually, it broke things ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671082779
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
The Display bound can be removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671100935
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
Maybe remove the `#[derive(Debug)]` on `TestError`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671119037
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
Crap, apparently `#[test]` requires the return type to implement `Debug`.
Then just keep the `Display` bound and add a comment that it is needed so that the `From` implementation doesn't apply to `TestError`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671100935
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
Maybe remove the `#[derive(Debug)]`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671106656
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
This helped! Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 merged PR #393:
URL: https://github.com/apache/avro-rs/pull/393
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Print the Debug impl of TestError for more info [avro-rs]
Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on code in PR #393:
URL: https://github.com/apache/avro-rs/pull/393#discussion_r2671091122
##########
avro_test_helper/src/lib.rs:
##########
@@ -56,10 +56,10 @@ pub struct TestError {}
/// A converter of any error into [TestError].
/// It is used to print better error messages in the tests.
/// Borrowed from <https://bluxte.net/musings/2023/01/08/improving_failure_messages_rust_tests/>
-impl<Err: std::fmt::Display> From<Err> for TestError {
+impl<Err: std::fmt::Display + std::fmt::Debug> From<Err> for TestError {
Review Comment:
I tried but it failed with:
```
error[E0119]: conflicting implementations of trait `From<TestError>` for type `TestError`
--> avro_test_helper/src/lib.rs:59:1
|
59 | impl<Err: std::fmt::Debug> From<Err> for TestError {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> From<T> for T;
For more information about this error, try `rustc --explain E0119`.
error: could not compile `apache-avro-test-helper` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
```
Let me try harder!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org