ValidComponentAmalgamation::cert may change shape depending on traits in scope
ValidComponentAmalgamation
derefs to ComponentAmalgamation
which has a method ComponentAmalgamation::cert
, so invoking foo.cert()
on a foo: &ValidComponentAmalgamation
will succeed and return &Cert
.
However, if you have the trait ValidAmalgamation
in scope, then ValidAmalgamation::cert
will shadow the former method, and now suddenly the same expression foo.cert()
will resolve differently and return a &ValidCert
.