diff --git a/compiler/rustc_attr_parsing/src/attributes/prototype.rs b/compiler/rustc_attr_parsing/src/attributes/prototype.rs index e77096743dd0..e23e2ba633f7 100644 --- a/compiler/rustc_attr_parsing/src/attributes/prototype.rs +++ b/compiler/rustc_attr_parsing/src/attributes/prototype.rs @@ -82,7 +82,7 @@ fn extract_value( } let Some(val) = arg.name_value() else { - cx.adcx().expected_single_argument(arg.span().unwrap_or(span), 2); + cx.adcx().expected_name_value(span, Some(key)); *failed = true; return; };