Disallow cfg
attribute (maybe others) on generic parameters
#51279
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
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 ascfg
. To avoid doing the warning song and dance we did with#[must_use]
on functions, we should disallow them before the feature actually stabilizes.The text was updated successfully, but these errors were encountered: