Skip to content

Disallow cfg attribute (maybe others) on generic parameters #51279

Description

@Havvy

As of 1.27, it is legal to put attributes on generic parameters. E.g. fn foo<#[allow(dead_code)] T>(_t: T){}, although none of the current attributes do anything. This includes attributes we may want to use in the future, such as cfg. To avoid doing the warning song and dance we did with #[must_use] on functions, we should disallow them before the feature actually stabilizes.

Activity

  1. added
    A-attributesArea: Attributes (`#[…]`, `#![…]`)
    T-langRelevant to the language team
    on Jun 1, 2018
  2. kennytm commented on Jun 1, 2018

    @kennytm
    Member
  3. added a commit that references this issue on Jun 7, 2018
    26a9d58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions