anixe / doku

fn(Code) -> Docs
MIT License
80 stars 5 forks source link

"the trait bound ... is not satisfied" should point at the offending field #18

Closed Patryk27 closed 2 years ago

Patryk27 commented 2 years ago

Compiling this code:

#[derive(Document)]
struct Foo {
  bar: Bar,
}

struct Bar;

... will throw the trait bound ... is not satisfied at Document - it'd be nice if we pointed out bar: Bar instead, as does e.g. Serde.

Patryk27 commented 2 years ago

Closing as inactionable; Serde's example yields a pretty nice error message, because Serde generates self.bar.serialize(...) underneath, which the compiler simply pretty-prints in a nice way.