martin-g commented on PR #1683:
URL: https://github.com/apache/avro/pull/1683#issuecomment-1124175647

   Good guess!
   I've extracted the code in a separate app and now it indeed fails with:
   ```
      Compiling derive-test v0.1.0 (/home/martin/tmp/rust/derive-test)
   error: cannot find derive macro `AvroSchema` in this scope
    --> src/main.rs:6:41
     |
   6 | #[derive(Debug, Serialize, Deserialize, AvroSchema)]
     |                                         ^^^^^^^^^^
     |
   note: `AvroSchema` is imported here, but it is only a trait, without a 
derive macro
    --> src/main.rs:2:5
     |
   2 | use apache_avro::AvroSchema;
     |     ^^^^^^^^^^^^^^^^^^^^^^^
   
   error[E0599]: no function or associated item named `get_schema` found for 
struct `A` in the current scope
     --> src/main.rs:14:42
      |
   7  | struct A {
      | -------- function or associated item `get_schema` not found for this
   ...
   14 |     println!("Derived schema: {:#?}", A::get_schema());
      |                                          ^^^^^^^^^^ function or 
associated item not found in `A`
      |
      = help: items from traits can only be used if the trait is implemented 
and in scope
      = note: the following trait defines an item `get_schema`, perhaps you 
need to implement it:
              candidate #1: `AvroSchema`
   
   For more information about this error, try `rustc --explain E0599`.
   error: could not compile `derive-test` due to 2 previous errors
   ```
   
   I will remove the new example and merge!


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to