diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index e42d716d5ae0..3dd3cc537e6f 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -339,7 +339,7 @@ impl<'a> AstValidator<'a> { match &*fn_decl.inputs { [Param { ty, span, .. }] => { if let TyKind::CVarArgs = ty.kind { - self.session.emit_err(CVarArgsWithoutNamedArg { span: *span }); + self.session.emit_err(CVarArgsIsSoleParam { span: *span }); } } [ps @ .., _] => { diff --git a/compiler/rustc_ast_passes/src/errors.rs b/compiler/rustc_ast_passes/src/errors.rs index 2b6d3d2a39a2..d376f638bd2e 100644 --- a/compiler/rustc_ast_passes/src/errors.rs +++ b/compiler/rustc_ast_passes/src/errors.rs @@ -114,8 +114,8 @@ pub struct TooManyParams { } #[derive(SessionDiagnostic)] -#[error(ast_passes::c_var_args_without_named_arg)] -pub struct CVarArgsWithoutNamedArg { +#[error(ast_passes::c_var_args_is_sole_param)] +pub struct CVarArgsIsSoleParam { #[primary_span] pub span: Span, } diff --git a/compiler/rustc_error_messages/locales/en-US/ast_passes.ftl b/compiler/rustc_error_messages/locales/en-US/ast_passes.ftl index bca73baea004..49ef0cc83de3 100644 --- a/compiler/rustc_error_messages/locales/en-US/ast_passes.ftl +++ b/compiler/rustc_error_messages/locales/en-US/ast_passes.ftl @@ -41,7 +41,7 @@ ast_passes_forbidden_non_lifetime_param = ast_passes_too_many_params = function can not have more than {$max_num_args} arguments -ast_passes_c_var_args_without_named_arg = +ast_passes_c_var_args_is_sole_param = C-variadic function must be declared with at least one named argument ast_passes_c_var_args_not_last =