Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[terminal_async] use latest #[diagnostic::on_unimplemented] feature in compiler #327

Open
nazmulidris opened this issue May 14, 2024 · 0 comments

Comments

@nazmulidris
Copy link
Member

nazmulidris commented May 14, 2024

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());
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant