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

Restrict what symbols can be used in #[diagnostic::on_unimplemented] format strings #118495

Merged
merged 1 commit into from
Dec 4, 2023

Commits on Dec 4, 2023

  1. Restrict what symbols can be used in `#[diagnostic::on_unimplemented]…

    …` format strings
    
    This commit restricts what symbols can be used in a format string for
    any option of the `diagnostic::on_unimplemented` attribute. We
    previously allowed all the ad-hoc options supported by the internal
    `#[rustc_on_unimplemented]` attribute. For the stable attribute we only
    want to support generic parameter names and `{Self}` as parameters.  For
    any other parameter an warning is emitted and the parameter is replaced
    by the literal parameter string, so for example `{integer}` turns into
    `{integer}`. This follows the general design of attributes in the
    `#[diagnostic]` attribute namespace, that any syntax "error" is treated
    as warning and subsequently ignored.
    weiznich committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    1a1cd6e View commit details
    Browse the repository at this point in the history