From 08bd4ff9987fc57215a2fe54c63da0e86d9e6fbf Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Fri, 8 Feb 2019 17:30:42 +0000 Subject: [PATCH] Rename variadic to c_variadic Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`. --- src/librustc/hir/lowering.rs | 6 +-- src/librustc/hir/mod.rs | 2 +- src/librustc/hir/print.rs | 2 +- src/librustc/ich/impls_hir.rs | 2 +- src/librustc/ich/impls_ty.rs | 2 +- src/librustc/traits/select.rs | 2 +- src/librustc/ty/context.rs | 6 +-- src/librustc/ty/instance.rs | 2 +- src/librustc/ty/relate.rs | 6 +-- src/librustc/ty/structural_impls.rs | 4 +- src/librustc/ty/sty.rs | 8 ++-- src/librustc/util/ppaux.rs | 8 ++-- src/librustc_codegen_llvm/abi.rs | 10 ++-- .../debuginfo/type_names.rs | 2 +- src/librustc_codegen_ssa/mir/block.rs | 6 +-- src/librustc_codegen_ssa/mir/mod.rs | 2 +- src/librustc_lint/types.rs | 2 +- .../borrow_check/nll/type_check/mod.rs | 4 +- src/librustc_mir/monomorphize/item.rs | 2 +- src/librustc_target/abi/call/arm.rs | 2 +- src/librustc_target/abi/call/mod.rs | 2 +- .../chalk_context/program_clauses.rs | 8 ++-- src/librustc_traits/generic_types.rs | 4 +- src/librustc_typeck/astconv.rs | 6 +-- src/librustc_typeck/check/callee.rs | 6 +-- src/librustc_typeck/check/closure.rs | 10 ++-- src/librustc_typeck/check/mod.rs | 24 +++++----- src/librustc_typeck/lib.rs | 14 +++--- src/libsyntax/ast.rs | 2 +- src/libsyntax/ext/build.rs | 2 +- src/libsyntax/mut_visit.rs | 2 +- src/libsyntax/parse/parser.rs | 48 +++++++++---------- src/libsyntax/print/pprust.rs | 4 +- .../pprust-expr-roundtrip.rs | 2 +- src/test/ui/c-variadic/variadic-ffi-1.stderr | 4 +- src/test/ui/c-variadic/variadic-ffi-2.stderr | 4 +- src/test/ui/error-codes/E0045.stderr | 4 +- .../ui/invalid/invalid-variadic-function.rs | 2 +- .../invalid/invalid-variadic-function.stderr | 2 +- src/test/ui/parser/variadic-ffi-3.rs | 2 +- src/test/ui/parser/variadic-ffi-3.stderr | 2 +- src/test/ui/parser/variadic-ffi-4.rs | 2 +- src/test/ui/parser/variadic-ffi-4.stderr | 2 +- 43 files changed, 119 insertions(+), 119 deletions(-) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 0e2b34d4fac..6e96054bea9 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -954,7 +954,7 @@ impl<'a> LoweringContext<'a> { let decl = FnDecl { inputs: vec![], output, - variadic: false + c_variadic: false }; let body_id = self.record_body(body_expr, Some(&decl)); self.is_generator = prev_is_generator; @@ -2118,7 +2118,7 @@ impl<'a> LoweringContext<'a> { P(hir::FnDecl { inputs, output, - variadic: decl.variadic, + c_variadic: decl.c_variadic, implicit_self: decl.inputs.get(0).map_or( hir::ImplicitSelfKind::None, |arg| { @@ -3973,7 +3973,7 @@ impl<'a> LoweringContext<'a> { let outer_decl = FnDecl { inputs: decl.inputs.clone(), output: FunctionRetTy::Default(fn_decl_span), - variadic: false, + c_variadic: false, }; // We need to lower the declaration outside the new scope, because we // have to conserve the state of being inside a loop condition for the diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 205109d18fe..d8169d05dd4 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1868,7 +1868,7 @@ pub struct Arg { pub struct FnDecl { pub inputs: HirVec, pub output: FunctionRetTy, - pub variadic: bool, + pub c_variadic: bool, /// Does the function have an implicit self? pub implicit_self: ImplicitSelfKind, } diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 8c252b0d027..dab4b9c824d 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -2007,7 +2007,7 @@ impl<'a> State<'a> { s.print_type(ty)?; s.end() })?; - if decl.variadic { + if decl.c_variadic { self.s.word(", ...")?; } self.pclose()?; diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index b7ec5889d6a..77582278690 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -368,7 +368,7 @@ impl_stable_hash_for!(enum hir::TyKind { impl_stable_hash_for!(struct hir::FnDecl { inputs, output, - variadic, + c_variadic, implicit_self }); diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index cce1273b7f0..f77a88128f2 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -232,7 +232,7 @@ impl_stable_hash_for!(struct ty::GenSig<'tcx> { impl_stable_hash_for!(struct ty::FnSig<'tcx> { inputs_and_output, - variadic, + c_variadic, unsafety, abi }); diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index e85b84bce43..e7cc9618080 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -1944,7 +1944,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { if let ty::FnSig { unsafety: hir::Unsafety::Normal, abi: Abi::Rust, - variadic: false, + c_variadic: false, .. } = self_ty.fn_sig(self.tcx()).skip_binder() { diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index b37b632f4be..9767396147c 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -2453,7 +2453,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { self.mk_fn_sig( params_iter, s.output(), - s.variadic, + s.c_variadic, hir::Unsafety::Normal, abi::Abi::Rust, ) @@ -2779,7 +2779,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { pub fn mk_fn_sig(self, inputs: I, output: I::Item, - variadic: bool, + c_variadic: bool, unsafety: hir::Unsafety, abi: abi::Abi) -> , ty::FnSig<'tcx>>>::Output @@ -2788,7 +2788,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { { inputs.chain(iter::once(output)).intern_with(|xs| ty::FnSig { inputs_and_output: self.intern_type_list(xs), - variadic, unsafety, abi + c_variadic, unsafety, abi }) } diff --git a/src/librustc/ty/instance.rs b/src/librustc/ty/instance.rs index 709dce4589f..49ebd202813 100644 --- a/src/librustc/ty/instance.rs +++ b/src/librustc/ty/instance.rs @@ -65,7 +65,7 @@ impl<'a, 'tcx> Instance<'tcx> { sig.map_bound(|sig| tcx.mk_fn_sig( iter::once(*env_ty.skip_binder()).chain(sig.inputs().iter().cloned()), sig.output(), - sig.variadic, + sig.c_variadic, sig.unsafety, sig.abi )) diff --git a/src/librustc/ty/relate.rs b/src/librustc/ty/relate.rs index b15aa862901..2940757fa90 100644 --- a/src/librustc/ty/relate.rs +++ b/src/librustc/ty/relate.rs @@ -147,9 +147,9 @@ impl<'tcx> Relate<'tcx> for ty::FnSig<'tcx> { { let tcx = relation.tcx(); - if a.variadic != b.variadic { + if a.c_variadic != b.c_variadic { return Err(TypeError::VariadicMismatch( - expected_found(relation, &a.variadic, &b.variadic))); + expected_found(relation, &a.c_variadic, &b.c_variadic))); } let unsafety = relation.relate(&a.unsafety, &b.unsafety)?; let abi = relation.relate(&a.abi, &b.abi)?; @@ -171,7 +171,7 @@ impl<'tcx> Relate<'tcx> for ty::FnSig<'tcx> { }); Ok(ty::FnSig { inputs_and_output: tcx.mk_type_list(inputs_and_output)?, - variadic: a.variadic, + c_variadic: a.c_variadic, unsafety, abi, }) diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index a81d5c9d86e..f1a465e1f17 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -396,7 +396,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::FnSig<'a> { tcx.lift(&self.inputs_and_output).map(|x| { ty::FnSig { inputs_and_output: x, - variadic: self.variadic, + c_variadic: self.c_variadic, unsafety: self.unsafety, abi: self.abi, } @@ -832,7 +832,7 @@ BraceStructTypeFoldableImpl! { BraceStructTypeFoldableImpl! { impl<'tcx> TypeFoldable<'tcx> for ty::FnSig<'tcx> { - inputs_and_output, variadic, unsafety, abi + inputs_and_output, c_variadic, unsafety, abi } } diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 7ade035ce89..3fd2e38a3d3 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -979,11 +979,11 @@ impl<'tcx> PolyGenSig<'tcx> { /// /// - `inputs`: is the list of arguments and their modes. /// - `output`: is the return type. -/// - `variadic`: indicates whether this is a C-variadic function. +/// - `c_variadic`: indicates whether this is a C-variadic function. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)] pub struct FnSig<'tcx> { pub inputs_and_output: &'tcx List>, - pub variadic: bool, + pub c_variadic: bool, pub unsafety: hir::Unsafety, pub abi: abi::Abi, } @@ -1016,8 +1016,8 @@ impl<'tcx> PolyFnSig<'tcx> { pub fn output(&self) -> ty::Binder> { self.map_bound_ref(|fn_sig| fn_sig.output()) } - pub fn variadic(&self) -> bool { - self.skip_binder().variadic + pub fn c_variadic(&self) -> bool { + self.skip_binder().c_variadic } pub fn unsafety(&self) -> hir::Unsafety { self.skip_binder().unsafety diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index fbe9e3359bf..aecef3c5ec7 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -360,7 +360,7 @@ impl PrintContext { fn fn_sig(&mut self, f: &mut F, inputs: &[Ty<'_>], - variadic: bool, + c_variadic: bool, output: Ty<'_>) -> fmt::Result { write!(f, "(")?; @@ -370,7 +370,7 @@ impl PrintContext { for &ty in inputs { print!(f, self, write(", "), print_display(ty))?; } - if variadic { + if c_variadic { write!(f, ", ...")?; } } @@ -1074,10 +1074,10 @@ define_print! { } write!(f, "fn")?; - cx.fn_sig(f, self.inputs(), self.variadic, self.output()) + cx.fn_sig(f, self.inputs(), self.c_variadic, self.output()) } debug { - write!(f, "({:?}; variadic: {})->{:?}", self.inputs(), self.variadic, self.output()) + write!(f, "({:?}; c_variadic: {})->{:?}", self.inputs(), self.c_variadic, self.output()) } } } diff --git a/src/librustc_codegen_llvm/abi.rs b/src/librustc_codegen_llvm/abi.rs index aea62360651..49c9555a2c6 100644 --- a/src/librustc_codegen_llvm/abi.rs +++ b/src/librustc_codegen_llvm/abi.rs @@ -422,7 +422,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> { let mut inputs = sig.inputs(); let extra_args = if sig.abi == RustCall { - assert!(!sig.variadic && extra_args.is_empty()); + assert!(!sig.c_variadic && extra_args.is_empty()); match sig.inputs().last().unwrap().sty { ty::Tuple(ref tupled_arguments) => { @@ -435,7 +435,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> { } } } else { - assert!(sig.variadic || extra_args.is_empty()); + assert!(sig.c_variadic || extra_args.is_empty()); extra_args }; @@ -531,7 +531,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> { // If this is a C-variadic function, this is not the return value, // and there is one or more fixed arguments; ensure that the `VaList` // is ignored as an argument. - if sig.variadic { + if sig.c_variadic { match (last_arg_idx, arg_idx) { (Some(last_idx), Some(cur_idx)) if last_idx == cur_idx => { let va_list_did = match cx.tcx.lang_items().va_list() { @@ -589,7 +589,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> { args: inputs.iter().chain(extra_args).enumerate().map(|(i, ty)| { arg_of(ty, Some(i)) }).collect(), - variadic: sig.variadic, + c_variadic: sig.c_variadic, conv, }; fn_ty.adjust_for_abi(cx, sig.abi); @@ -717,7 +717,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> { llargument_tys.push(llarg_ty); } - if self.variadic { + if self.c_variadic { cx.type_variadic_func(&llargument_tys, llreturn_ty) } else { cx.type_func(&llargument_tys, llreturn_ty) diff --git a/src/librustc_codegen_llvm/debuginfo/type_names.rs b/src/librustc_codegen_llvm/debuginfo/type_names.rs index 176c9b8c542..8b218ab39d9 100644 --- a/src/librustc_codegen_llvm/debuginfo/type_names.rs +++ b/src/librustc_codegen_llvm/debuginfo/type_names.rs @@ -143,7 +143,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, output.pop(); } - if sig.variadic { + if sig.c_variadic { if !sig.inputs().is_empty() { output.push_str(", ..."); } else { diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index 684dfac991b..627380ee38f 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -232,7 +232,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { &mut self, mut bx: Bx, ) { - if self.fn_ty.variadic { + if self.fn_ty.c_variadic { if let Some(va_list) = self.va_list_ref { bx.va_end(va_list.llval); } @@ -507,7 +507,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // The "spoofed" `VaList` added to a C-variadic functions signature // should not be included in the `extra_args` calculation. - let extra_args_start_idx = sig.inputs().len() - if sig.variadic { 1 } else { 0 }; + let extra_args_start_idx = sig.inputs().len() - if sig.c_variadic { 1 } else { 0 }; let extra_args = &args[extra_args_start_idx..]; let extra_args = extra_args.iter().map(|op_arg| { let op_ty = op_arg.ty(self.mir, bx.tcx()); @@ -695,7 +695,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // an "spoofed" `VaList`. This argument is ignored, but we need to // populate it with a dummy operand so that the users real arguments // are not overwritten. - let i = if sig.variadic && last_arg_idx.map(|x| x == i).unwrap_or(false) { + let i = if sig.c_variadic && last_arg_idx.map(|x| x == i).unwrap_or(false) { let layout = match self.cx.tcx().lang_items().va_list() { Some(did) => bx.cx().layout_of(bx.tcx().type_of(did)), None => bug!("`va_list` language item required for C-variadics"), diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs index 95cf8cfe2d0..dc77d4673cd 100644 --- a/src/librustc_codegen_ssa/mir/mod.rs +++ b/src/librustc_codegen_ssa/mir/mod.rs @@ -585,7 +585,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( indirect_operand.store(bx, tmp); tmp } else { - if fx.fn_ty.variadic && last_arg_idx.map(|idx| arg_index == idx).unwrap_or(false) { + if fx.fn_ty.c_variadic && last_arg_idx.map(|idx| arg_index == idx).unwrap_or(false) { let va_list_impl = match arg_decl.ty.ty_adt_def() { Some(adt) => adt.non_enum_variant(), None => bug!("`va_list` language item improperly constructed") diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index fb279a5d9b8..35489ab42e7 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -766,7 +766,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { let def_id = self.cx.tcx.hir().local_def_id(id); let sig = self.cx.tcx.fn_sig(def_id); let sig = self.cx.tcx.erase_late_bound_regions(&sig); - let inputs = if sig.variadic { + let inputs = if sig.c_variadic { // Don't include the spoofed `VaList` in the functions list // of inputs. &sig.inputs()[..sig.inputs().len() - 1] diff --git a/src/librustc_mir/borrow_check/nll/type_check/mod.rs b/src/librustc_mir/borrow_check/nll/type_check/mod.rs index f897795d86f..df035aab54c 100644 --- a/src/librustc_mir/borrow_check/nll/type_check/mod.rs +++ b/src/librustc_mir/borrow_check/nll/type_check/mod.rs @@ -1604,12 +1604,12 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { debug!("check_call_inputs({:?}, {:?})", sig, args); // Do not count the `VaList` argument as a "true" argument to // a C-variadic function. - let inputs = if sig.variadic { + let inputs = if sig.c_variadic { &sig.inputs()[..sig.inputs().len() - 1] } else { &sig.inputs()[..] }; - if args.len() < inputs.len() || (args.len() > inputs.len() && !sig.variadic) { + if args.len() < inputs.len() || (args.len() > inputs.len() && !sig.c_variadic) { span_mirbug!(self, term, "call to {:?} with wrong # of args", sig); } for (n, (fn_arg, op_arg)) in inputs.iter().zip(args).enumerate() { diff --git a/src/librustc_mir/monomorphize/item.rs b/src/librustc_mir/monomorphize/item.rs index a26a1a7861e..059af2dbba9 100644 --- a/src/librustc_mir/monomorphize/item.rs +++ b/src/librustc_mir/monomorphize/item.rs @@ -353,7 +353,7 @@ impl<'a, 'tcx> DefPathBasedNames<'a, 'tcx> { output.pop(); } - if sig.variadic { + if sig.c_variadic { if !sig.inputs().is_empty() { output.push_str(", ..."); } else { diff --git a/src/librustc_target/abi/call/arm.rs b/src/librustc_target/abi/call/arm.rs index 52d7f3ac3dc..e3fee8e5700 100644 --- a/src/librustc_target/abi/call/arm.rs +++ b/src/librustc_target/abi/call/arm.rs @@ -99,7 +99,7 @@ pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>) // `extern "aapcs"`, then we must use the VFP registers for homogeneous aggregates. let vfp = cx.target_spec().llvm_target.ends_with("hf") && fty.conv != Conv::ArmAapcs - && !fty.variadic; + && !fty.c_variadic; if !fty.ret.is_ignore() { classify_ret_ty(cx, &mut fty.ret, vfp); diff --git a/src/librustc_target/abi/call/mod.rs b/src/librustc_target/abi/call/mod.rs index 8ada328a158..fbbd120f934 100644 --- a/src/librustc_target/abi/call/mod.rs +++ b/src/librustc_target/abi/call/mod.rs @@ -531,7 +531,7 @@ pub struct FnType<'a, Ty> { /// LLVM return type. pub ret: ArgType<'a, Ty>, - pub variadic: bool, + pub c_variadic: bool, pub conv: Conv, } diff --git a/src/librustc_traits/chalk_context/program_clauses.rs b/src/librustc_traits/chalk_context/program_clauses.rs index 4d8a67ca638..3f88d0e08b4 100644 --- a/src/librustc_traits/chalk_context/program_clauses.rs +++ b/src/librustc_traits/chalk_context/program_clauses.rs @@ -105,7 +105,7 @@ fn assemble_builtin_sized_impls<'tcx>( let fn_ptr = generic_types::fn_ptr( tcx, fn_ptr.inputs_and_output.len(), - fn_ptr.variadic, + fn_ptr.c_variadic, fn_ptr.unsafety, fn_ptr.abi ); @@ -190,11 +190,11 @@ fn wf_clause_for_raw_ptr<'tcx>( fn wf_clause_for_fn_ptr<'tcx>( tcx: ty::TyCtxt<'_, '_, 'tcx>, arity_and_output: usize, - variadic: bool, + c_variadic: bool, unsafety: hir::Unsafety, abi: abi::Abi ) -> Clauses<'tcx> { - let fn_ptr = generic_types::fn_ptr(tcx, arity_and_output, variadic, unsafety, abi); + let fn_ptr = generic_types::fn_ptr(tcx, arity_and_output, c_variadic, unsafety, abi); let wf_clause = ProgramClause { goal: DomainGoal::WellFormed(WellFormed::Ty(fn_ptr)), @@ -503,7 +503,7 @@ impl ChalkInferenceContext<'cx, 'gcx, 'tcx> { wf_clause_for_fn_ptr( self.infcx.tcx, fn_ptr.inputs_and_output.len(), - fn_ptr.variadic, + fn_ptr.c_variadic, fn_ptr.unsafety, fn_ptr.abi ) diff --git a/src/librustc_traits/generic_types.rs b/src/librustc_traits/generic_types.rs index 634c024b064..f2ce9631f35 100644 --- a/src/librustc_traits/generic_types.rs +++ b/src/librustc_traits/generic_types.rs @@ -24,7 +24,7 @@ crate fn raw_ptr(tcx: TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tcx> crate fn fn_ptr( tcx: ty::TyCtxt<'_, '_, 'tcx>, arity_and_output: usize, - variadic: bool, + c_variadic: bool, unsafety: hir::Unsafety, abi: abi::Abi ) -> Ty<'tcx> { @@ -37,7 +37,7 @@ crate fn fn_ptr( let fn_sig = ty::Binder::bind(ty::FnSig { inputs_and_output, - variadic, + c_variadic, unsafety, abi, }); diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 1d99584eec4..b3694752204 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -18,7 +18,7 @@ use rustc::ty::subst::{Kind, Subst, InternalSubsts, SubstsRef}; use rustc::ty::wf::object_region_bounds; use rustc_data_structures::sync::Lrc; use rustc_target::spec::abi; -use crate::require_c_abi_if_variadic; +use crate::require_c_abi_if_c_variadic; use smallvec::SmallVec; use syntax::ast; use syntax::feature_gate::{GateIssue, emit_feature_err}; @@ -1768,7 +1768,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { tcx.mk_tup(fields.iter().map(|t| self.ast_ty_to_ty(&t))) } hir::TyKind::BareFn(ref bf) => { - require_c_abi_if_variadic(tcx, &bf.decl, bf.abi, ast_ty.span); + require_c_abi_if_c_variadic(tcx, &bf.decl, bf.abi, ast_ty.span); tcx.mk_fn_ptr(self.ty_of_fn(bf.unsafety, bf.abi, &bf.decl)) } hir::TyKind::TraitObject(ref bounds, ref lifetime) => { @@ -1913,7 +1913,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { let bare_fn_ty = ty::Binder::bind(tcx.mk_fn_sig( input_tys, output_ty, - decl.variadic, + decl.c_variadic, unsafety, abi )); diff --git a/src/librustc_typeck/check/callee.rs b/src/librustc_typeck/check/callee.rs index aeb43635eb7..0a4c0eb3aff 100644 --- a/src/librustc_typeck/check/callee.rs +++ b/src/librustc_typeck/check/callee.rs @@ -368,7 +368,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { .0; let fn_sig = self.normalize_associated_types_in(call_expr.span, &fn_sig); - let inputs = if fn_sig.variadic { + let inputs = if fn_sig.c_variadic { if fn_sig.inputs().len() > 1 { &fn_sig.inputs()[..fn_sig.inputs().len() - 1] } else { @@ -391,7 +391,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { inputs, &expected_arg_tys[..], arg_exprs, - fn_sig.variadic, + fn_sig.c_variadic, TupleArgumentsFlag::DontTupleArguments, def_span, ); @@ -424,7 +424,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { fn_sig.inputs(), &expected_arg_tys, arg_exprs, - fn_sig.variadic, + fn_sig.c_variadic, TupleArgumentsFlag::TupleArguments, None, ); diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index 2a4b17a6399..db89b32be7b 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -141,7 +141,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.tcx.mk_fn_sig( iter::once(self.tcx.intern_tup(sig.inputs())), sig.output(), - sig.variadic, + sig.c_variadic, sig.unsafety, sig.abi, ) @@ -386,7 +386,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // Watch out for some surprises and just ignore the // expectation if things don't see to match up with what we // expect. - if expected_sig.sig.variadic != decl.variadic { + if expected_sig.sig.c_variadic != decl.c_variadic { return self.sig_of_closure_no_expectation(expr_def_id, decl, body); } else if expected_sig.sig.inputs_and_output.len() != decl.inputs.len() + 1 { return self.sig_of_closure_with_mismatched_number_of_arguments( @@ -404,7 +404,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let bound_sig = ty::Binder::bind(self.tcx.mk_fn_sig( expected_sig.sig.inputs().iter().cloned(), expected_sig.sig.output(), - decl.variadic, + decl.c_variadic, hir::Unsafety::Normal, Abi::RustCall, )); @@ -586,7 +586,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let result = ty::Binder::bind(self.tcx.mk_fn_sig( supplied_arguments, supplied_return, - decl.variadic, + decl.c_variadic, hir::Unsafety::Normal, Abi::RustCall, )); @@ -621,7 +621,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let result = ty::Binder::bind(self.tcx.mk_fn_sig( supplied_arguments, self.tcx.types.err, - decl.variadic, + decl.c_variadic, hir::Unsafety::Normal, Abi::RustCall, )); diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 202d8bec4e9..3a430f77b6c 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -130,7 +130,7 @@ use std::mem::replace; use std::ops::{self, Deref}; use std::slice; -use crate::require_c_abi_if_variadic; +use crate::require_c_abi_if_c_variadic; use crate::session::{CompileIncomplete, Session}; use crate::session::config::EntryFnType; use crate::TypeAndSubsts; @@ -1072,7 +1072,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>, fn_sig = fcx.tcx.mk_fn_sig( fn_sig.inputs().iter().cloned(), revealed_ret_ty, - fn_sig.variadic, + fn_sig.c_variadic, fn_sig.unsafety, fn_sig.abi ); @@ -1426,7 +1426,7 @@ pub fn check_item_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, it: &'tcx hir::Ite } if let hir::ForeignItemKind::Fn(ref fn_decl, _, _) = item.node { - require_c_abi_if_variadic(tcx, fn_decl, m.abi, item.span); + require_c_abi_if_c_variadic(tcx, fn_decl, m.abi, item.span); } } } @@ -2783,7 +2783,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { &method.sig.inputs()[1..] ); self.check_argument_types(sp, expr_sp, &method.sig.inputs()[1..], &expected_arg_tys[..], - args_no_rcvr, method.sig.variadic, tuple_arguments, + args_no_rcvr, method.sig.c_variadic, tuple_arguments, self.tcx.hir().span_if_local(method.def_id)); method.sig.output() } @@ -2862,7 +2862,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { fn_inputs: &[Ty<'tcx>], mut expected_arg_tys: &[Ty<'tcx>], args: &'gcx [hir::Expr], - variadic: bool, + c_variadic: bool, tuple_arguments: TupleArgumentsFlag, def_span: Option) { let tcx = self.tcx; @@ -2886,11 +2886,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let param_count_error = |expected_count: usize, arg_count: usize, error_code: &str, - variadic: bool, + c_variadic: bool, sugg_unit: bool| { let mut err = tcx.sess.struct_span_err_with_code(sp, &format!("this function takes {}{} but {} {} supplied", - if variadic {"at least "} else {""}, + if c_variadic { "at least " } else { "" }, potentially_plural_count(expected_count, "parameter"), potentially_plural_count(arg_count, "parameter"), if arg_count == 1 {"was"} else {"were"}), @@ -2910,7 +2910,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { Applicability::MachineApplicable); } else { err.span_label(sp, format!("expected {}{}", - if variadic {"at least "} else {""}, + if c_variadic { "at least " } else { "" }, potentially_plural_count(expected_count, "parameter"))); } err.emit(); @@ -2944,7 +2944,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } } else if expected_arg_count == supplied_arg_count { fn_inputs.to_vec() - } else if variadic { + } else if c_variadic { if supplied_arg_count >= expected_arg_count { fn_inputs.to_vec() } else { @@ -2991,10 +2991,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.select_obligations_where_possible(false); } - // For variadic functions, we don't have a declared type for all of + // For C-variadic functions, we don't have a declared type for all of // the arguments hence we only do our usual type checking with // the arguments who's types we do know. - let t = if variadic { + let t = if c_variadic { expected_arg_count } else if tuple_arguments == TupleArguments { args.len() @@ -3043,7 +3043,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // We also need to make sure we at least write the ty of the other // arguments which we skipped above. - if variadic { + if c_variadic { fn variadic_error<'tcx>(s: &Session, span: Span, t: Ty<'tcx>, cast_ty: &str) { use crate::structured_errors::{VariadicError, StructuredDiagnostic}; VariadicError::new(s, span, t, cast_ty).diagnostic().emit(); diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 419796a2014..2095c81d0fb 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -136,14 +136,14 @@ fn check_type_alias_enum_variants_enabled<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, } } -fn require_c_abi_if_variadic(tcx: TyCtxt<'_, '_, '_>, - decl: &hir::FnDecl, - abi: Abi, - span: Span) { - if decl.variadic && !(abi == Abi::C || abi == Abi::Cdecl) { +fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_, '_, '_>, + decl: &hir::FnDecl, + abi: Abi, + span: Span) { + if decl.c_variadic && !(abi == Abi::C || abi == Abi::Cdecl) { let mut err = struct_span_err!(tcx.sess, span, E0045, - "variadic function must have C or cdecl calling convention"); - err.span_label(span, "variadics require C or cdecl calling convention").emit(); + "C-variadic function must have C or cdecl calling convention"); + err.span_label(span, "C-variadics require C or cdecl calling convention").emit(); } } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 5bae00b9cb8..b4bf6665d4e 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1804,7 +1804,7 @@ impl Arg { pub struct FnDecl { pub inputs: Vec, pub output: FunctionRetTy, - pub variadic: bool, + pub c_variadic: bool, } impl FnDecl { diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 27b0cfb1630..0bdc7fd60cb 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -985,7 +985,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { P(ast::FnDecl { inputs, output, - variadic: false + c_variadic: false }) } diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 8efc4689cac..032a0e993ae 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -673,7 +673,7 @@ pub fn noop_visit_asyncness(asyncness: &mut IsAsync, vis: &mut T) } pub fn noop_visit_fn_decl(decl: &mut P, vis: &mut T) { - let FnDecl { inputs, output, variadic: _ } = decl.deref_mut(); + let FnDecl { inputs, output, c_variadic: _ } = decl.deref_mut(); visit_vec(inputs, |input| vis.visit_arg(input)); match output { FunctionRetTy::Default(span) => vis.visit_span(span), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b58091b57da..5f3b08bf942 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1457,12 +1457,12 @@ impl<'a> Parser<'a> { }; self.expect_keyword(keywords::Fn)?; - let (inputs, variadic) = self.parse_fn_args(false, true)?; + let (inputs, c_variadic) = self.parse_fn_args(false, true)?; let ret_ty = self.parse_ret_ty(false)?; let decl = P(FnDecl { inputs, output: ret_ty, - variadic, + c_variadic, }); Ok(TyKind::BareFn(P(BareFnTy { abi, @@ -1635,7 +1635,7 @@ impl<'a> Parser<'a> { } fn parse_ty_common(&mut self, allow_plus: bool, allow_qpath_recovery: bool, - allow_variadic: bool) -> PResult<'a, P> { + allow_c_variadic: bool) -> PResult<'a, P> { maybe_whole!(self, NtTy, |x| x); let lo = self.span; @@ -1773,12 +1773,12 @@ impl<'a> Parser<'a> { } } } else if self.check(&token::DotDotDot) { - if allow_variadic { + if allow_c_variadic { self.eat(&token::DotDotDot); TyKind::CVarArgs } else { return Err(self.fatal( - "only foreign functions are allowed to be variadic" + "only foreign functions are allowed to be C-variadic" )); } } else { @@ -1969,7 +1969,7 @@ impl<'a> Parser<'a> { /// This version of parse arg doesn't necessarily require identifier names. fn parse_arg_general(&mut self, require_name: bool, is_trait_item: bool, - allow_variadic: bool) -> PResult<'a, Arg> { + allow_c_variadic: bool) -> PResult<'a, Arg> { maybe_whole!(self, NtArg, |x| x); if let Ok(Some(_)) = self.parse_self_arg() { @@ -2018,12 +2018,12 @@ impl<'a> Parser<'a> { } self.eat_incorrect_doc_comment("a method argument's type"); - (pat, self.parse_ty_common(true, true, allow_variadic)?) + (pat, self.parse_ty_common(true, true, allow_c_variadic)?) } else { debug!("parse_arg_general ident_to_pat"); let parser_snapshot_before_ty = self.clone(); self.eat_incorrect_doc_comment("a method argument's type"); - let mut ty = self.parse_ty_common(true, true, allow_variadic); + let mut ty = self.parse_ty_common(true, true, allow_c_variadic); if ty.is_ok() && self.token != token::Comma && self.token != token::CloseDelim(token::Paren) { // This wasn't actually a type, but a pattern looking like a type, @@ -2042,7 +2042,7 @@ impl<'a> Parser<'a> { (pat, ty) } Err(mut err) => { - // If this is a variadic argument and we hit an error, return the + // If this is a C-variadic argument and we hit an error, return the // error. if self.token == token::DotDotDot { return Err(err); @@ -6122,12 +6122,12 @@ impl<'a> Parser<'a> { Ok(where_clause) } - fn parse_fn_args(&mut self, named_args: bool, allow_variadic: bool) + fn parse_fn_args(&mut self, named_args: bool, allow_c_variadic: bool) -> PResult<'a, (Vec , bool)> { self.expect(&token::OpenDelim(token::Paren))?; let sp = self.span; - let mut variadic = false; + let mut c_variadic = false; let (args, recovered): (Vec>, bool) = self.parse_seq_to_before_end( &token::CloseDelim(token::Paren), @@ -6141,14 +6141,14 @@ impl<'a> Parser<'a> { named_args }; match p.parse_arg_general(enforce_named_args, false, - allow_variadic) { + allow_c_variadic) { Ok(arg) => { if let TyKind::CVarArgs = arg.ty.node { - variadic = true; + c_variadic = true; if p.token != token::CloseDelim(token::Paren) { let span = p.span; p.span_err(span, - "`...` must be last in argument list in variadic function"); + "`...` must be the last argument of a C-variadic function"); Ok(None) } else { Ok(Some(arg)) @@ -6176,24 +6176,24 @@ impl<'a> Parser<'a> { let args: Vec<_> = args.into_iter().filter_map(|x| x).collect(); - if variadic && args.is_empty() { + if c_variadic && args.is_empty() { self.span_err(sp, - "variadic function must be declared with at least one named argument"); + "C-variadic function must be declared with at least one named argument"); } - Ok((args, variadic)) + Ok((args, c_variadic)) } /// Parses the argument list and result type of a function declaration. - fn parse_fn_decl(&mut self, allow_variadic: bool) -> PResult<'a, P> { + fn parse_fn_decl(&mut self, allow_c_variadic: bool) -> PResult<'a, P> { - let (args, variadic) = self.parse_fn_args(true, allow_variadic)?; + let (args, c_variadic) = self.parse_fn_args(true, allow_c_variadic)?; let ret_ty = self.parse_ret_ty(true)?; Ok(P(FnDecl { inputs: args, output: ret_ty, - variadic, + c_variadic, })) } @@ -6340,7 +6340,7 @@ impl<'a> Parser<'a> { Ok(P(FnDecl { inputs: fn_inputs, output: self.parse_ret_ty(true)?, - variadic: false + c_variadic: false })) } @@ -6366,7 +6366,7 @@ impl<'a> Parser<'a> { Ok(P(FnDecl { inputs: inputs_captures, output, - variadic: false + c_variadic: false })) } @@ -6398,8 +6398,8 @@ impl<'a> Parser<'a> { abi: Abi) -> PResult<'a, ItemInfo> { let (ident, mut generics) = self.parse_fn_header()?; - let allow_variadic = abi == Abi::C && unsafety == Unsafety::Unsafe; - let decl = self.parse_fn_decl(allow_variadic)?; + let allow_c_variadic = abi == Abi::C && unsafety == Unsafety::Unsafe; + let decl = self.parse_fn_decl(allow_c_variadic)?; generics.where_clause = self.parse_where_clause()?; let (inner_attrs, body) = self.parse_inner_attrs_and_block()?; let header = FnHeader { unsafety, asyncness, constness, abi }; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index b3964d0ce9c..4f4336c5b27 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2814,7 +2814,7 @@ impl<'a> State<'a> { -> io::Result<()> { self.popen()?; self.commasep(Inconsistent, &decl.inputs, |s, arg| s.print_arg(arg, false))?; - if decl.variadic { + if decl.c_variadic { self.s.word(", ...")?; } self.pclose()?; @@ -3241,7 +3241,7 @@ mod tests { let decl = ast::FnDecl { inputs: Vec::new(), output: ast::FunctionRetTy::Default(syntax_pos::DUMMY_SP), - variadic: false + c_variadic: false }; let generics = ast::Generics::default(); assert_eq!( diff --git a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs index 956bc5ad862..80e0b0102af 100644 --- a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs +++ b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs @@ -112,7 +112,7 @@ fn iter_exprs(depth: usize, f: &mut FnMut(P)) { let decl = P(FnDecl { inputs: vec![], output: FunctionRetTy::Default(DUMMY_SP), - variadic: false, + c_variadic: false, }); iter_exprs(depth - 1, &mut |e| g( ExprKind::Closure(CaptureBy::Value, diff --git a/src/test/ui/c-variadic/variadic-ffi-1.stderr b/src/test/ui/c-variadic/variadic-ffi-1.stderr index 52d7394d6af..61d55ce0d3e 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-1.stderr @@ -1,8 +1,8 @@ -error[E0045]: variadic function must have C or cdecl calling convention +error[E0045]: C-variadic function must have C or cdecl calling convention --> $DIR/variadic-ffi-1.rs:5:5 | LL | fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C or cdecl calling - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variadics require C or cdecl calling convention + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention error: aborting due to previous error diff --git a/src/test/ui/c-variadic/variadic-ffi-2.stderr b/src/test/ui/c-variadic/variadic-ffi-2.stderr index cb2a9f874b7..4c8b8d2b2e1 100644 --- a/src/test/ui/c-variadic/variadic-ffi-2.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-2.stderr @@ -1,8 +1,8 @@ -error[E0045]: variadic function must have C or cdecl calling convention +error[E0045]: C-variadic function must have C or cdecl calling convention --> $DIR/variadic-ffi-2.rs:3:11 | LL | fn baz(f: extern "stdcall" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variadics require C or cdecl calling convention + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0045.stderr b/src/test/ui/error-codes/E0045.stderr index b38bbc169bd..0ce91f0a401 100644 --- a/src/test/ui/error-codes/E0045.stderr +++ b/src/test/ui/error-codes/E0045.stderr @@ -1,8 +1,8 @@ -error[E0045]: variadic function must have C or cdecl calling convention +error[E0045]: C-variadic function must have C or cdecl calling convention --> $DIR/E0045.rs:1:17 | LL | extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045 - | ^^^^^^^^^^^^^^^^^^^ variadics require C or cdecl calling convention + | ^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention error: aborting due to previous error diff --git a/src/test/ui/invalid/invalid-variadic-function.rs b/src/test/ui/invalid/invalid-variadic-function.rs index aea630e7c26..8d23f0e4770 100644 --- a/src/test/ui/invalid/invalid-variadic-function.rs +++ b/src/test/ui/invalid/invalid-variadic-function.rs @@ -1,3 +1,3 @@ extern "C" fn foo(x: u8, ...); -//~^ ERROR only foreign functions are allowed to be variadic +//~^ ERROR only foreign functions are allowed to be C-variadic //~| ERROR expected one of `->`, `where`, or `{`, found `;` diff --git a/src/test/ui/invalid/invalid-variadic-function.stderr b/src/test/ui/invalid/invalid-variadic-function.stderr index 7a0b8066fd5..b2dbf8b9190 100644 --- a/src/test/ui/invalid/invalid-variadic-function.stderr +++ b/src/test/ui/invalid/invalid-variadic-function.stderr @@ -1,4 +1,4 @@ -error: only foreign functions are allowed to be variadic +error: only foreign functions are allowed to be C-variadic --> $DIR/invalid-variadic-function.rs:1:26 | LL | extern "C" fn foo(x: u8, ...); diff --git a/src/test/ui/parser/variadic-ffi-3.rs b/src/test/ui/parser/variadic-ffi-3.rs index 13bce27bb83..ce83cc87abe 100644 --- a/src/test/ui/parser/variadic-ffi-3.rs +++ b/src/test/ui/parser/variadic-ffi-3.rs @@ -1,5 +1,5 @@ fn foo(x: isize, ...) { - //~^ ERROR: only foreign functions are allowed to be variadic + //~^ ERROR: only foreign functions are allowed to be C-variadic } fn main() {} diff --git a/src/test/ui/parser/variadic-ffi-3.stderr b/src/test/ui/parser/variadic-ffi-3.stderr index 150de9e63d3..8ea4d194396 100644 --- a/src/test/ui/parser/variadic-ffi-3.stderr +++ b/src/test/ui/parser/variadic-ffi-3.stderr @@ -1,4 +1,4 @@ -error: only foreign functions are allowed to be variadic +error: only foreign functions are allowed to be C-variadic --> $DIR/variadic-ffi-3.rs:1:18 | LL | fn foo(x: isize, ...) { diff --git a/src/test/ui/parser/variadic-ffi-4.rs b/src/test/ui/parser/variadic-ffi-4.rs index 812ed256a5d..5f8b3f8f539 100644 --- a/src/test/ui/parser/variadic-ffi-4.rs +++ b/src/test/ui/parser/variadic-ffi-4.rs @@ -1,5 +1,5 @@ extern "C" fn foo(x: isize, ...) { - //~^ ERROR: only foreign functions are allowed to be variadic + //~^ ERROR: only foreign functions are allowed to be C-variadic } fn main() {} diff --git a/src/test/ui/parser/variadic-ffi-4.stderr b/src/test/ui/parser/variadic-ffi-4.stderr index 2d036b0cf37..69fbf84869c 100644 --- a/src/test/ui/parser/variadic-ffi-4.stderr +++ b/src/test/ui/parser/variadic-ffi-4.stderr @@ -1,4 +1,4 @@ -error: only foreign functions are allowed to be variadic +error: only foreign functions are allowed to be C-variadic --> $DIR/variadic-ffi-4.rs:1:29 | LL | extern "C" fn foo(x: isize, ...) {