r3bl-open-core
r3bl-open-core copied to clipboard
[terminal_async] use latest #[diagnostic::on_unimplemented] feature in compiler
Try and use diagnostic attributes, which is a brand new compiler feature, to decorate important traits (eg: SharedWriter
).
#[test]
fn name() {
#[diagnostic::on_unimplemented(
message = "`ImportantTrait<{A}>` is not implemented for `{Self}`",
label = "My Label",
note = "Note 1",
note = "Note 2"
)]
trait ImportantTrait<A> {}
fn use_my_trait(_: impl ImportantTrait<i32>) {}
fn main() {
use_my_trait(String::new());
}
}