Rollup merge of #92366 - jhpratt:derive-default-enum, r=Mark-Simulacrum

Resolve concern of `derive_default_enum`

This resolves the concern in favor of prohibiting multiple instances of
the attribute. This is similar to non-helper attributes as introduced in
#88681.

``@rustbot`` label +S-waiting-on-review +T-libs-api
This commit is contained in:
Matthias Krüger 2022-02-16 18:59:27 +01:00 committed by GitHub
commit 6930b6676a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 3 deletions

View File

@ -222,9 +222,6 @@ fn validate_default_attribute(
"this method must only be called with a variant that has a `#[default]` attribute", "this method must only be called with a variant that has a `#[default]` attribute",
), ),
[first, rest @ ..] => { [first, rest @ ..] => {
// FIXME(jhpratt) Do we want to perform this check? It doesn't exist
// for `#[inline]`, `#[non_exhaustive]`, and presumably others.
let suggestion_text = let suggestion_text =
if rest.len() == 1 { "try removing this" } else { "try removing these" }; if rest.len() == 1 { "try removing this" } else { "try removing these" };