diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index d342d96a10f..354815a103b 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -473,7 +473,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { call_expr: &hir::Expr<'tcx>, ) { // Next, let's construct the error - let (error_span, full_call_span, ctor_of, is_method) = match &call_expr.kind { + let (error_span, full_call_span, call_name, is_method) = match &call_expr.kind { hir::ExprKind::Call( hir::Expr { hir_id, span, kind: hir::ExprKind::Path(qpath), .. }, _, @@ -481,12 +481,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if let Res::Def(DefKind::Ctor(of, _), _) = self.typeck_results.borrow().qpath_res(qpath, *hir_id) { - (call_span, *span, Some(of), false) + let name = match of { + CtorOf::Struct => "struct", + CtorOf::Variant => "enum variant", + }; + (call_span, *span, name, false) } else { - (call_span, *span, None, false) + (call_span, *span, "function", false) } } - hir::ExprKind::Call(hir::Expr { span, .. }, _) => (call_span, *span, None, false), + hir::ExprKind::Call(hir::Expr { span, .. }, _) => (call_span, *span, "function", false), hir::ExprKind::MethodCall(path_segment, _, _, span) => { let ident_span = path_segment.ident.span; let ident_span = if let Some(args) = path_segment.args { @@ -494,17 +498,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } else { ident_span }; - // methods are never ctors - (*span, ident_span, None, true) + (*span, ident_span, "method", true) } k => span_bug!(call_span, "checking argument types on a non-call: `{:?}`", k), }; let args_span = error_span.trim_start(full_call_span).unwrap_or(error_span); - let call_name = match ctor_of { - Some(CtorOf::Struct) => "struct", - Some(CtorOf::Variant) => "enum variant", - None => "function", - }; // Don't print if it has error types or is just plain `_` fn has_error_or_infer<'tcx>(tys: impl IntoIterator>) -> bool { @@ -690,8 +688,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err = tcx.sess.struct_span_err_with_code( full_call_span, &format!( - "this {} takes {}{} but {} {} supplied", - call_name, + "{call_name} takes {}{} but {} {} supplied", if c_variadic { "at least " } else { "" }, potentially_plural_count( formal_and_expected_inputs.len(), diff --git a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs index 8430fabe84d..ea9ad39a70d 100644 --- a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs +++ b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs @@ -7,7 +7,7 @@ struct Layout; #[alloc_error_handler] -fn oom() -> ! { //~ ERROR this function takes 0 arguments but 1 argument was supplied +fn oom() -> ! { //~ ERROR function takes 0 arguments but 1 argument was supplied loop {} } diff --git a/src/test/ui/argument-suggestions/basic.rs b/src/test/ui/argument-suggestions/basic.rs index 3e96322d67e..961e7a50e56 100644 --- a/src/test/ui/argument-suggestions/basic.rs +++ b/src/test/ui/argument-suggestions/basic.rs @@ -18,11 +18,11 @@ fn permuted(_x: X, _y: Y, _z: Z) {} fn main() { invalid(1.0); //~ ERROR mismatched types - extra(""); //~ ERROR this function takes - missing(); //~ ERROR this function takes + extra(""); //~ ERROR function takes + missing(); //~ ERROR function takes swapped("", 1); //~ ERROR arguments to this function are incorrect permuted(Y {}, Z {}, X {}); //~ ERROR arguments to this function are incorrect let closure = |x| x; - closure(); //~ ERROR this function takes + closure(); //~ ERROR function takes } diff --git a/src/test/ui/argument-suggestions/display-is-suggestable.rs b/src/test/ui/argument-suggestions/display-is-suggestable.rs index d765bc4f74d..acb61f54308 100644 --- a/src/test/ui/argument-suggestions/display-is-suggestable.rs +++ b/src/test/ui/argument-suggestions/display-is-suggestable.rs @@ -4,5 +4,5 @@ fn foo(x: &(dyn Display + Send)) {} fn main() { foo(); - //~^ ERROR this function takes 1 argument but 0 arguments were supplied + //~^ ERROR function takes 1 argument but 0 arguments were supplied } diff --git a/src/test/ui/argument-suggestions/exotic-calls.rs b/src/test/ui/argument-suggestions/exotic-calls.rs index a18e967668d..569a39a2b45 100644 --- a/src/test/ui/argument-suggestions/exotic-calls.rs +++ b/src/test/ui/argument-suggestions/exotic-calls.rs @@ -1,11 +1,11 @@ fn foo(t: T) { t(1i32); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied + //~^ ERROR function takes 0 arguments but 1 argument was supplied } fn bar(t: impl Fn()) { t(1i32); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied + //~^ ERROR function takes 0 arguments but 1 argument was supplied } fn baz() -> impl Fn() { @@ -14,13 +14,13 @@ fn baz() -> impl Fn() { fn baz2() { baz()(1i32) - //~^ ERROR this function takes 0 arguments but 1 argument was supplied + //~^ ERROR function takes 0 arguments but 1 argument was supplied } fn qux() { let x = || {}; x(1i32); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied + //~^ ERROR function takes 0 arguments but 1 argument was supplied } fn main() {} diff --git a/src/test/ui/argument-suggestions/extern-fn-arg-names.rs b/src/test/ui/argument-suggestions/extern-fn-arg-names.rs index 6c925a3d653..df2fd6624cd 100644 --- a/src/test/ui/argument-suggestions/extern-fn-arg-names.rs +++ b/src/test/ui/argument-suggestions/extern-fn-arg-names.rs @@ -5,5 +5,5 @@ extern "Rust" { fn main() { dstfn(1); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied + //~^ ERROR function takes 2 arguments but 1 argument was supplied } diff --git a/src/test/ui/argument-suggestions/extra_arguments.rs b/src/test/ui/argument-suggestions/extra_arguments.rs index 3706ac4e8e1..3f83de95e2d 100644 --- a/src/test/ui/argument-suggestions/extra_arguments.rs +++ b/src/test/ui/argument-suggestions/extra_arguments.rs @@ -4,30 +4,30 @@ fn two_arg_same(_a: i32, _b: i32) {} fn two_arg_diff(_a: i32, _b: &str) {} fn main() { - empty(""); //~ ERROR this function takes + empty(""); //~ ERROR function takes - one_arg(1, 1); //~ ERROR this function takes - one_arg(1, ""); //~ ERROR this function takes - one_arg(1, "", 1.0); //~ ERROR this function takes + one_arg(1, 1); //~ ERROR function takes + one_arg(1, ""); //~ ERROR function takes + one_arg(1, "", 1.0); //~ ERROR function takes - two_arg_same(1, 1, 1); //~ ERROR this function takes - two_arg_same(1, 1, 1.0); //~ ERROR this function takes + two_arg_same(1, 1, 1); //~ ERROR function takes + two_arg_same(1, 1, 1.0); //~ ERROR function takes - two_arg_diff(1, 1, ""); //~ ERROR this function takes - two_arg_diff(1, "", ""); //~ ERROR this function takes - two_arg_diff(1, 1, "", ""); //~ ERROR this function takes - two_arg_diff(1, "", 1, ""); //~ ERROR this function takes + two_arg_diff(1, 1, ""); //~ ERROR function takes + two_arg_diff(1, "", ""); //~ ERROR function takes + two_arg_diff(1, 1, "", ""); //~ ERROR function takes + two_arg_diff(1, "", 1, ""); //~ ERROR function takes // Check with weird spacing and newlines - two_arg_same(1, 1, ""); //~ ERROR this function takes - two_arg_diff(1, 1, ""); //~ ERROR this function takes - two_arg_same( //~ ERROR this function takes + two_arg_same(1, 1, ""); //~ ERROR function takes + two_arg_diff(1, 1, ""); //~ ERROR function takes + two_arg_same( //~ ERROR function takes 1, 1, "" ); - two_arg_diff( //~ ERROR this function takes + two_arg_diff( //~ ERROR function takes 1, 1, "" diff --git a/src/test/ui/argument-suggestions/issue-100154.rs b/src/test/ui/argument-suggestions/issue-100154.rs index 4446b4bc2fc..fb0af05e9dc 100644 --- a/src/test/ui/argument-suggestions/issue-100154.rs +++ b/src/test/ui/argument-suggestions/issue-100154.rs @@ -2,6 +2,6 @@ fn foo(i: impl std::fmt::Display) {} fn main() { foo::<()>(()); - //~^ ERROR this function takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR function takes 0 generic arguments but 1 generic argument was supplied //~| ERROR `()` doesn't implement `std::fmt::Display` } diff --git a/src/test/ui/argument-suggestions/issue-100478.rs b/src/test/ui/argument-suggestions/issue-100478.rs index 6bef6ad1038..fb50fa11537 100644 --- a/src/test/ui/argument-suggestions/issue-100478.rs +++ b/src/test/ui/argument-suggestions/issue-100478.rs @@ -31,7 +31,7 @@ fn three_diff(_a: T1, _b: T2, _c: T3) {} fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {} fn main() { - three_diff(T2::new(0)); //~ ERROR this function takes + three_diff(T2::new(0)); //~ ERROR function takes four_shuffle(T3::default(), T4::default(), T1::default(), T2::default()); //~ ERROR 35:5: 35:17: arguments to this function are incorrect [E0308] four_shuffle(T3::default(), T2::default(), T1::default(), T3::default()); //~ ERROR 36:5: 36:17: arguments to this function are incorrect [E0308] diff --git a/src/test/ui/argument-suggestions/issue-101097.rs b/src/test/ui/argument-suggestions/issue-101097.rs index 7994d3cd995..25f7f583799 100644 --- a/src/test/ui/argument-suggestions/issue-101097.rs +++ b/src/test/ui/argument-suggestions/issue-101097.rs @@ -13,7 +13,7 @@ fn f( ) {} fn main() { - f(C, A, A, A, B, B, C); //~ ERROR this function takes 6 arguments but 7 arguments were supplied [E0061] + f(C, A, A, A, B, B, C); //~ ERROR function takes 6 arguments but 7 arguments were supplied [E0061] f(C, C, A, A, B, B); //~ ERROR arguments to this function are incorrect [E0308] f(A, A, D, D, B, B); //~ arguments to this function are incorrect [E0308] f(C, C, B, B, A, A); //~ arguments to this function are incorrect [E0308] diff --git a/src/test/ui/argument-suggestions/issue-96638.rs b/src/test/ui/argument-suggestions/issue-96638.rs index 9c6e81ab8cc..5e720f174c2 100644 --- a/src/test/ui/argument-suggestions/issue-96638.rs +++ b/src/test/ui/argument-suggestions/issue-96638.rs @@ -5,5 +5,5 @@ fn arg() -> T { todo!() } fn main() { let x = arg(); // `x` must be inferred // The reference on `&x` is important to reproduce the ICE - f(&x, ""); //~ ERROR this function takes 3 arguments but 2 arguments were supplied + f(&x, ""); //~ ERROR function takes 3 arguments but 2 arguments were supplied } diff --git a/src/test/ui/argument-suggestions/issue-97197.rs b/src/test/ui/argument-suggestions/issue-97197.rs index 6f9f4293e49..4c22608ae6a 100644 --- a/src/test/ui/argument-suggestions/issue-97197.rs +++ b/src/test/ui/argument-suggestions/issue-97197.rs @@ -1,6 +1,6 @@ fn main() { g((), ()); - //~^ ERROR this function takes 6 arguments but 2 arguments were supplied + //~^ ERROR function takes 6 arguments but 2 arguments were supplied } pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {} diff --git a/src/test/ui/argument-suggestions/issue-97484.rs b/src/test/ui/argument-suggestions/issue-97484.rs index bb383ab1f8b..9e537b0c35f 100644 --- a/src/test/ui/argument-suggestions/issue-97484.rs +++ b/src/test/ui/argument-suggestions/issue-97484.rs @@ -10,5 +10,5 @@ fn foo(a: &A, d: D, e: &E, g: G) {} fn main() { foo(&&A, B, C, D, E, F, G); - //~^ ERROR this function takes 4 arguments but 7 arguments were supplied + //~^ ERROR function takes 4 arguments but 7 arguments were supplied } diff --git a/src/test/ui/argument-suggestions/issue-98894.rs b/src/test/ui/argument-suggestions/issue-98894.rs index c2618a96716..e421eba9775 100644 --- a/src/test/ui/argument-suggestions/issue-98894.rs +++ b/src/test/ui/argument-suggestions/issue-98894.rs @@ -1,4 +1,4 @@ fn main() { (|_, ()| ())(if true {} else {return;}); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied + //~^ ERROR function takes 2 arguments but 1 argument was supplied } diff --git a/src/test/ui/argument-suggestions/issue-98897.rs b/src/test/ui/argument-suggestions/issue-98897.rs index c55f495d698..27734f74dee 100644 --- a/src/test/ui/argument-suggestions/issue-98897.rs +++ b/src/test/ui/argument-suggestions/issue-98897.rs @@ -1,4 +1,4 @@ fn main() { (|_, ()| ())([return, ()]); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied + //~^ ERROR function takes 2 arguments but 1 argument was supplied } diff --git a/src/test/ui/argument-suggestions/issue-99482.rs b/src/test/ui/argument-suggestions/issue-99482.rs index 731b863069b..7bbb39f8d62 100644 --- a/src/test/ui/argument-suggestions/issue-99482.rs +++ b/src/test/ui/argument-suggestions/issue-99482.rs @@ -1,5 +1,5 @@ fn main() { let f = |_: (), f: fn()| f; let _f = f(main); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied + //~^ ERROR function takes 2 arguments but 1 argument was supplied } diff --git a/src/test/ui/argument-suggestions/missing_arguments.rs b/src/test/ui/argument-suggestions/missing_arguments.rs index ae0dabf27b1..c26564641cb 100644 --- a/src/test/ui/argument-suggestions/missing_arguments.rs +++ b/src/test/ui/argument-suggestions/missing_arguments.rs @@ -7,34 +7,34 @@ fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {} fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {} fn main() { - one_arg(); //~ ERROR this function takes + one_arg(); //~ ERROR function takes // The headers here show the types expected, // with formatting to emphasize which arguments are missing /* i32 f32 */ - two_same( ); //~ ERROR this function takes - two_same( 1 ); //~ ERROR this function takes - two_diff( ); //~ ERROR this function takes - two_diff( 1 ); //~ ERROR this function takes - two_diff( 1.0 ); //~ ERROR this function takes + two_same( ); //~ ERROR function takes + two_same( 1 ); //~ ERROR function takes + two_diff( ); //~ ERROR function takes + two_diff( 1 ); //~ ERROR function takes + two_diff( 1.0 ); //~ ERROR function takes /* i32 i32 i32 */ - three_same( ); //~ ERROR this function takes - three_same( 1 ); //~ ERROR this function takes - three_same( 1, 1 ); //~ ERROR this function takes + three_same( ); //~ ERROR function takes + three_same( 1 ); //~ ERROR function takes + three_same( 1, 1 ); //~ ERROR function takes /* i32 f32 &str */ - three_diff( 1.0, "" ); //~ ERROR this function takes - three_diff( 1, "" ); //~ ERROR this function takes - three_diff( 1, 1.0 ); //~ ERROR this function takes - three_diff( "" ); //~ ERROR this function takes - three_diff( 1.0 ); //~ ERROR this function takes - three_diff( 1 ); //~ ERROR this function takes + three_diff( 1.0, "" ); //~ ERROR function takes + three_diff( 1, "" ); //~ ERROR function takes + three_diff( 1, 1.0 ); //~ ERROR function takes + three_diff( "" ); //~ ERROR function takes + three_diff( 1.0 ); //~ ERROR function takes + three_diff( 1 ); //~ ERROR function takes /* i32 f32 f32 &str */ - four_repeated( ); //~ ERROR this function takes - four_repeated( 1, "" ); //~ ERROR this function takes + four_repeated( ); //~ ERROR function takes + four_repeated( 1, "" ); //~ ERROR function takes /* i32 f32 i32 f32 &str */ - complex( ); //~ ERROR this function takes - complex( 1, "" ); //~ ERROR this function takes + complex( ); //~ ERROR function takes + complex( 1, "" ); //~ ERROR function takes } diff --git a/src/test/ui/argument-suggestions/mixed_cases.rs b/src/test/ui/argument-suggestions/mixed_cases.rs index 73678482b30..86e94a4382c 100644 --- a/src/test/ui/argument-suggestions/mixed_cases.rs +++ b/src/test/ui/argument-suggestions/mixed_cases.rs @@ -7,11 +7,11 @@ fn three_args(_a: i32, _b: f32, _c: &str) {} fn main() { // Extra + Invalid - two_args(1, "", X {}); //~ ERROR this function takes - three_args(1, "", X {}, ""); //~ ERROR this function takes + two_args(1, "", X {}); //~ ERROR function takes + three_args(1, "", X {}, ""); //~ ERROR function takes // Missing and Invalid - three_args(1, X {}); //~ ERROR this function takes + three_args(1, X {}); //~ ERROR function takes // Missing and Extra three_args(1, "", X {}); //~ ERROR arguments to this function are incorrect @@ -20,5 +20,5 @@ fn main() { three_args("", X {}, 1); //~ ERROR arguments to this function are incorrect // Swapped and missing - three_args("", 1); //~ ERROR this function takes + three_args("", 1); //~ ERROR function takes } diff --git a/src/test/ui/argument-suggestions/too-long.stderr b/src/test/ui/argument-suggestions/too-long.stderr index bd430194c5e..4928943294b 100644 --- a/src/test/ui/argument-suggestions/too-long.stderr +++ b/src/test/ui/argument-suggestions/too-long.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l); | --- ^ expected `i32`, found `&i32` | | - | arguments to this function are incorrect + | arguments to this method are incorrect | note: associated function defined here --> $DIR/too-long.rs:4:8 diff --git a/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr index e761c6c62a6..d6b18d4ed32 100644 --- a/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr +++ b/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr @@ -32,7 +32,7 @@ error[E0308]: mismatched types LL | fn f() { ModelT.chip_paint(Blue); } | ---------- ^^^^ expected struct `Black`, found struct `Blue` | | - | arguments to this function are incorrect + | arguments to this method are incorrect | note: associated function defined here --> $DIR/associated-type-projection-from-supertrait.rs:12:8 @@ -46,7 +46,7 @@ error[E0308]: mismatched types LL | fn g() { ModelU.chip_paint(Black); } | ---------- ^^^^^ expected struct `Blue`, found struct `Black` | | - | arguments to this function are incorrect + | arguments to this method are incorrect | note: associated function defined here --> $DIR/associated-type-projection-from-supertrait.rs:12:8 diff --git a/src/test/ui/c-variadic/variadic-ffi-1.rs b/src/test/ui/c-variadic/variadic-ffi-1.rs index 24407a71ce6..acd8a25dc53 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.rs +++ b/src/test/ui/c-variadic/variadic-ffi-1.rs @@ -19,8 +19,8 @@ extern "C" fn bar(f: isize, x: u8) {} fn main() { unsafe { - foo(); //~ ERROR this function takes at least 2 arguments but 0 arguments were supplied - foo(1); //~ ERROR this function takes at least 2 arguments but 1 argument was supplied + foo(); //~ ERROR function takes at least 2 arguments but 0 arguments were supplied + foo(1); //~ ERROR function takes at least 2 arguments but 1 argument was supplied let x: unsafe extern "C" fn(f: isize, x: u8) = foo; //~ ERROR mismatched types let y: extern "C" fn(f: isize, x: u8, ...) = bar; //~ ERROR mismatched types diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs index faa8b3d10de..10247ce6bca 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs @@ -13,5 +13,5 @@ fn test() where Bool<{core::mem::size_of::() > 4}>: True { fn main() { test::<2>(); - //~^ ERROR this function takes 2 generic arguments + //~^ ERROR function takes 2 generic arguments } diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.rs b/src/test/ui/const-generics/incorrect-number-of-const-args.rs index de2d126afd7..8660cb2fb54 100644 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.rs +++ b/src/test/ui/const-generics/incorrect-number-of-const-args.rs @@ -4,8 +4,8 @@ fn foo() -> usize { fn main() { foo::<0>(); - //~^ ERROR this function takes 2 + //~^ ERROR function takes 2 foo::<0, 0, 0>(); - //~^ ERROR this function takes 2 + //~^ ERROR function takes 2 } diff --git a/src/test/ui/fn/issue-3044.rs b/src/test/ui/fn/issue-3044.rs index 7c626a01b12..19bee733ec0 100644 --- a/src/test/ui/fn/issue-3044.rs +++ b/src/test/ui/fn/issue-3044.rs @@ -1,6 +1,6 @@ fn main() { let needlesArr: Vec = vec!['a', 'f']; needlesArr.iter().fold(|x, y| { - //~^ ERROR this function takes 2 arguments but 1 argument was supplied + //~^ ERROR this method takes 2 arguments but 1 argument was supplied }); } diff --git a/src/test/ui/fn/issue-3044.stderr b/src/test/ui/fn/issue-3044.stderr index 1232b83c391..2690ad71176 100644 --- a/src/test/ui/fn/issue-3044.stderr +++ b/src/test/ui/fn/issue-3044.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 2 arguments but 1 argument was supplied +error[E0061]: this method takes 2 arguments but 1 argument was supplied --> $DIR/issue-3044.rs:3:23 | LL | needlesArr.iter().fold(|x, y| { diff --git a/src/test/ui/generator/issue-102645.rs b/src/test/ui/generator/issue-102645.rs index 0589c5a009a..35acd5cd727 100644 --- a/src/test/ui/generator/issue-102645.rs +++ b/src/test/ui/generator/issue-102645.rs @@ -14,7 +14,7 @@ fn main() { a = d; }; Pin::new(&mut b).resume(); - //~^ ERROR this function takes 1 argument but 0 arguments were supplied + //~^ ERROR this method takes 1 argument but 0 arguments were supplied // This type error is required to reproduce the ICE... } diff --git a/src/test/ui/generator/issue-102645.stderr b/src/test/ui/generator/issue-102645.stderr index afb39c9e594..f6d2440295e 100644 --- a/src/test/ui/generator/issue-102645.stderr +++ b/src/test/ui/generator/issue-102645.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 1 argument but 0 arguments were supplied +error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/issue-102645.rs:16:22 | LL | Pin::new(&mut b).resume(); diff --git a/src/test/ui/higher-rank-trait-bounds/issue-58451.rs b/src/test/ui/higher-rank-trait-bounds/issue-58451.rs index f36d549e476..6006a108c5c 100644 --- a/src/test/ui/higher-rank-trait-bounds/issue-58451.rs +++ b/src/test/ui/higher-rank-trait-bounds/issue-58451.rs @@ -9,5 +9,5 @@ where {} fn main() { - f(&[f()]); //~ ERROR this function takes 1 argument + f(&[f()]); //~ ERROR function takes 1 argument } diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs index 7249a36f5fe..a93bdb1788f 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs @@ -2,5 +2,5 @@ fn f(_: impl AsRef, _: impl AsRef) {} fn main() { f::<[u8]>("a", b"a"); - //~^ ERROR: this function takes 2 generic arguments but 1 generic argument was supplied + //~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied } diff --git a/src/test/ui/issues/issue-11374.stderr b/src/test/ui/issues/issue-11374.stderr index 15b2bbeb7c2..ace77814a3a 100644 --- a/src/test/ui/issues/issue-11374.stderr +++ b/src/test/ui/issues/issue-11374.stderr @@ -6,7 +6,7 @@ LL | c.read_to(v); | | | | | expected `&mut [u8]`, found struct `Vec` | | help: consider mutably borrowing here: `&mut v` - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected mutable reference `&mut [u8]` found struct `Vec<_>` diff --git a/src/test/ui/issues/issue-26094.rs b/src/test/ui/issues/issue-26094.rs index df8c2f73910..d3d670aa92a 100644 --- a/src/test/ui/issues/issue-26094.rs +++ b/src/test/ui/issues/issue-26094.rs @@ -8,6 +8,6 @@ fn some_function() {} //~ NOTE defined here fn main() { some_macro!(some_function); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied + //~^ ERROR function takes 0 arguments but 1 argument was supplied //~| NOTE in this expansion of some_macro! } diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index da3e62e35dc..60bbfc0c6e2 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | b"".starts_with(stringify!(foo)) | ----------- ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str` | | - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected reference `&[u8]` found reference `&'static str` diff --git a/src/test/ui/issues/issue-4935.rs b/src/test/ui/issues/issue-4935.rs index b342bbb1b8e..c95020a0c00 100644 --- a/src/test/ui/issues/issue-4935.rs +++ b/src/test/ui/issues/issue-4935.rs @@ -3,4 +3,4 @@ fn foo(a: usize) {} //~^ defined here fn main() { foo(5, 6) } -//~^ ERROR this function takes 1 argument but 2 arguments were supplied +//~^ ERROR function takes 1 argument but 2 arguments were supplied diff --git a/src/test/ui/lifetimes/issue-26638.rs b/src/test/ui/lifetimes/issue-26638.rs index 000ab6492bb..4bec3b3415b 100644 --- a/src/test/ui/lifetimes/issue-26638.rs +++ b/src/test/ui/lifetimes/issue-26638.rs @@ -5,7 +5,7 @@ fn parse_type(iter: Box+'static>) -> &str { iter.next() fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } //~^ ERROR missing lifetime specifier [E0106] //~| ERROR mismatched types -//~| ERROR this function takes 1 argument but 0 arguments were supplied +//~| ERROR function takes 1 argument but 0 arguments were supplied fn parse_type_3() -> &str { unimplemented!() } //~^ ERROR missing lifetime specifier [E0106] diff --git a/src/test/ui/methods/issues/issue-61525.stderr b/src/test/ui/methods/issues/issue-61525.stderr index aec968d7c44..3e73b950a14 100644 --- a/src/test/ui/methods/issues/issue-61525.stderr +++ b/src/test/ui/methods/issues/issue-61525.stderr @@ -23,7 +23,7 @@ error[E0308]: mismatched types LL | 1.query::("") | --------------------- ^^ expected trait object `dyn ToString`, found `&str` | | - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected trait object `dyn ToString` found reference `&'static str` diff --git a/src/test/ui/methods/method-call-err-msg.rs b/src/test/ui/methods/method-call-err-msg.rs index d53ef445afc..4807a956aa2 100644 --- a/src/test/ui/methods/method-call-err-msg.rs +++ b/src/test/ui/methods/method-call-err-msg.rs @@ -10,13 +10,13 @@ impl Foo { fn main() { let x = Foo; - x.zero(0) //~ ERROR this function takes 0 arguments but 1 argument was supplied - .one() //~ ERROR this function takes 1 argument but 0 arguments were supplied - .two(0); //~ ERROR this function takes 2 arguments but 1 argument was supplied + x.zero(0) //~ ERROR this method takes 0 arguments but 1 argument was supplied + .one() //~ ERROR this method takes 1 argument but 0 arguments were supplied + .two(0); //~ ERROR this method takes 2 arguments but 1 argument was supplied let y = Foo; y.zero() .take() //~ ERROR not an iterator .one(0); - y.three::(); //~ ERROR this function takes 3 arguments but 0 arguments were supplied + y.three::(); //~ ERROR this method takes 3 arguments but 0 arguments were supplied } diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index 3f4e647491e..81269b73b9a 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 0 arguments but 1 argument was supplied +error[E0061]: this method takes 0 arguments but 1 argument was supplied --> $DIR/method-call-err-msg.rs:13:7 | LL | x.zero(0) @@ -14,7 +14,7 @@ help: remove the extra argument LL | x.zero() | ~~ -error[E0061]: this function takes 1 argument but 0 arguments were supplied +error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/method-call-err-msg.rs:14:7 | LL | .one() @@ -30,7 +30,7 @@ help: provide the argument LL | .one(/* isize */) | ~~~~~~~~~~~~~ -error[E0061]: this function takes 2 arguments but 1 argument was supplied +error[E0061]: this method takes 2 arguments but 1 argument was supplied --> $DIR/method-call-err-msg.rs:15:7 | LL | .two(0); @@ -67,7 +67,7 @@ note: the trait `Iterator` must be implemented = note: the following trait defines an item `take`, perhaps you need to implement it: candidate #1: `Iterator` -error[E0061]: this function takes 3 arguments but 0 arguments were supplied +error[E0061]: this method takes 3 arguments but 0 arguments were supplied --> $DIR/method-call-err-msg.rs:21:7 | LL | y.three::(); diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.rs b/src/test/ui/mismatched_types/overloaded-calls-bad.rs index 232cd2ba88c..5b1804d825d 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.rs +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.rs @@ -33,9 +33,9 @@ fn main() { let ans = s("what"); //~^ ERROR mismatched types let ans = s(); - //~^ ERROR this function takes 1 argument but 0 arguments were supplied + //~^ ERROR function takes 1 argument but 0 arguments were supplied let ans = s("burma", "shave"); - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR function takes 1 argument but 2 arguments were supplied F(""); //~^ ERROR mismatched types diff --git a/src/test/ui/not-enough-arguments.rs b/src/test/ui/not-enough-arguments.rs index 42476255188..4a2ea5e44c7 100644 --- a/src/test/ui/not-enough-arguments.rs +++ b/src/test/ui/not-enough-arguments.rs @@ -25,7 +25,7 @@ fn bar( fn main() { foo(1, 2, 3); - //~^ ERROR this function takes 4 arguments but 3 + //~^ ERROR function takes 4 arguments but 3 bar(1, 2, 3); - //~^ ERROR this function takes 6 arguments but 3 + //~^ ERROR function takes 6 arguments but 3 } diff --git a/src/test/ui/resolve/resolve-primitive-fallback.rs b/src/test/ui/resolve/resolve-primitive-fallback.rs index 992bcd7977f..05cabd9e3cd 100644 --- a/src/test/ui/resolve/resolve-primitive-fallback.rs +++ b/src/test/ui/resolve/resolve-primitive-fallback.rs @@ -2,7 +2,7 @@ fn main() { // Make sure primitive type fallback doesn't work in value namespace std::mem::size_of(u16); //~^ ERROR expected value, found builtin type `u16` - //~| ERROR this function takes 0 arguments but 1 argument was supplied + //~| ERROR function takes 0 arguments but 1 argument was supplied // Make sure primitive type fallback doesn't work with global paths let _: ::u8; diff --git a/src/test/ui/span/issue-34264.rs b/src/test/ui/span/issue-34264.rs index 5b8fc71384e..9227ee482df 100644 --- a/src/test/ui/span/issue-34264.rs +++ b/src/test/ui/span/issue-34264.rs @@ -4,8 +4,8 @@ fn bar(x, y: usize) {} //~ ERROR expected one of fn main() { foo(Some(42), 2); - foo(Some(42), 2, ""); //~ ERROR this function takes + foo(Some(42), 2, ""); //~ ERROR function takes bar("", ""); //~ ERROR mismatched types bar(1, 2); - bar(1, 2, 3); //~ ERROR this function takes + bar(1, 2, 3); //~ ERROR function takes } diff --git a/src/test/ui/span/missing-unit-argument.rs b/src/test/ui/span/missing-unit-argument.rs index 5b9861da6e8..db96ae223d9 100644 --- a/src/test/ui/span/missing-unit-argument.rs +++ b/src/test/ui/span/missing-unit-argument.rs @@ -9,9 +9,9 @@ impl S { fn main() { let _: Result<(), String> = Ok(); //~ ERROR this enum variant takes - foo(); //~ ERROR this function takes - foo(()); //~ ERROR this function takes - bar(); //~ ERROR this function takes - S.baz(); //~ ERROR this function takes - S.generic::<()>(); //~ ERROR this function takes + foo(); //~ ERROR function takes + foo(()); //~ ERROR function takes + bar(); //~ ERROR function takes + S.baz(); //~ ERROR this method takes + S.generic::<()>(); //~ ERROR this method takes } diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr index 48a2e763af6..ef4d732b51d 100644 --- a/src/test/ui/span/missing-unit-argument.stderr +++ b/src/test/ui/span/missing-unit-argument.stderr @@ -59,7 +59,7 @@ help: provide the argument LL | bar(()); | ~~~~ -error[E0061]: this function takes 1 argument but 0 arguments were supplied +error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:15:7 | LL | S.baz(); @@ -75,7 +75,7 @@ help: provide the argument LL | S.baz(()); | ~~~~ -error[E0061]: this function takes 1 argument but 0 arguments were supplied +error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:16:7 | LL | S.generic::<()>(); diff --git a/src/test/ui/suggestions/args-instead-of-tuple-errors.rs b/src/test/ui/suggestions/args-instead-of-tuple-errors.rs index 5403b8d6d28..f5931a1baea 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple-errors.rs +++ b/src/test/ui/suggestions/args-instead-of-tuple-errors.rs @@ -6,7 +6,7 @@ fn main() { let _: Option<(i32, bool)> = Some(1, 2); //~^ ERROR this enum variant takes 1 argument but 2 arguments were supplied int_bool(1, 2); - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR function takes 1 argument but 2 arguments were supplied let _: Option<(i8,)> = Some(); //~^ ERROR this enum variant takes 1 argument but 0 arguments were supplied diff --git a/src/test/ui/suggestions/args-instead-of-tuple.fixed b/src/test/ui/suggestions/args-instead-of-tuple.fixed index 66e53f9ce2c..f913995d7e2 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple.fixed +++ b/src/test/ui/suggestions/args-instead-of-tuple.fixed @@ -5,11 +5,11 @@ fn main() { let _: Result<(i32, i8), ()> = Ok((1, 2)); - //~^ ERROR this enum variant takes 1 argument but 2 arguments were supplied + //~^ ERROR enum variant takes 1 argument but 2 arguments were supplied let _: Option<(i32, i8, &'static str)> = Some((1, 2, "hi")); - //~^ ERROR this enum variant takes 1 argument but 3 arguments were supplied + //~^ ERROR enum variant takes 1 argument but 3 arguments were supplied let _: Option<()> = Some(()); - //~^ ERROR this enum variant takes 1 argument but 0 arguments were supplied + //~^ ERROR enum variant takes 1 argument but 0 arguments were supplied let _: Option<(i32,)> = Some((3,)); //~^ ERROR mismatched types @@ -17,9 +17,9 @@ fn main() { let _: Option<(i32,)> = Some((3,)); //~^ ERROR mismatched types - two_ints((1, 2)); //~ ERROR this function takes 1 argument + two_ints((1, 2)); //~ ERROR function takes 1 argument - with_generic((3, 4)); //~ ERROR this function takes 1 argument + with_generic((3, 4)); //~ ERROR function takes 1 argument } fn two_ints(_: (i32, i32)) { @@ -28,6 +28,6 @@ fn two_ints(_: (i32, i32)) { fn with_generic((a, b): (i32, T)) { if false { // test generics/bound handling - with_generic((a, b)); //~ ERROR this function takes 1 argument + with_generic((a, b)); //~ ERROR function takes 1 argument } } diff --git a/src/test/ui/suggestions/args-instead-of-tuple.rs b/src/test/ui/suggestions/args-instead-of-tuple.rs index a15bff07ebf..1c65407b395 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple.rs +++ b/src/test/ui/suggestions/args-instead-of-tuple.rs @@ -5,11 +5,11 @@ fn main() { let _: Result<(i32, i8), ()> = Ok(1, 2); - //~^ ERROR this enum variant takes 1 argument but 2 arguments were supplied + //~^ ERROR enum variant takes 1 argument but 2 arguments were supplied let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); - //~^ ERROR this enum variant takes 1 argument but 3 arguments were supplied + //~^ ERROR enum variant takes 1 argument but 3 arguments were supplied let _: Option<()> = Some(); - //~^ ERROR this enum variant takes 1 argument but 0 arguments were supplied + //~^ ERROR enum variant takes 1 argument but 0 arguments were supplied let _: Option<(i32,)> = Some(3); //~^ ERROR mismatched types @@ -17,9 +17,9 @@ fn main() { let _: Option<(i32,)> = Some((3)); //~^ ERROR mismatched types - two_ints(1, 2); //~ ERROR this function takes 1 argument + two_ints(1, 2); //~ ERROR function takes 1 argument - with_generic(3, 4); //~ ERROR this function takes 1 argument + with_generic(3, 4); //~ ERROR function takes 1 argument } fn two_ints(_: (i32, i32)) { @@ -28,6 +28,6 @@ fn two_ints(_: (i32, i32)) { fn with_generic((a, b): (i32, T)) { if false { // test generics/bound handling - with_generic(a, b); //~ ERROR this function takes 1 argument + with_generic(a, b); //~ ERROR function takes 1 argument } } diff --git a/src/test/ui/suggestions/args-instead-of-tuple.stderr b/src/test/ui/suggestions/args-instead-of-tuple.stderr index c8499010d68..3ed9dbf4abb 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple.stderr +++ b/src/test/ui/suggestions/args-instead-of-tuple.stderr @@ -1,4 +1,4 @@ -error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied +error[E0061]: enum variant takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:7:36 | LL | let _: Result<(i32, i8), ()> = Ok(1, 2); @@ -11,7 +11,7 @@ help: wrap these arguments in parentheses to construct a tuple LL | let _: Result<(i32, i8), ()> = Ok((1, 2)); | + + -error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied +error[E0061]: enum variant takes 1 argument but 3 arguments were supplied --> $DIR/args-instead-of-tuple.rs:9:46 | LL | let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi"); @@ -71,7 +71,7 @@ help: use a trailing comma to create a tuple with one element LL | let _: Option<(i32,)> = Some((3,)); | + -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:20:5 | LL | two_ints(1, 2); @@ -87,7 +87,7 @@ help: wrap these arguments in parentheses to construct a tuple LL | two_ints((1, 2)); | + + -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:22:5 | LL | with_generic(3, 4); @@ -103,7 +103,7 @@ help: wrap these arguments in parentheses to construct a tuple LL | with_generic((3, 4)); | + + -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple.rs:31:9 | LL | with_generic(a, b); diff --git a/src/test/ui/suggestions/missing-type-param-used-in-param.fixed b/src/test/ui/suggestions/missing-type-param-used-in-param.fixed index cc4120041b9..be439403104 100644 --- a/src/test/ui/suggestions/missing-type-param-used-in-param.fixed +++ b/src/test/ui/suggestions/missing-type-param-used-in-param.fixed @@ -3,6 +3,6 @@ fn two_type_params(_: B) {} fn main() { - two_type_params::(100); //~ ERROR this function takes 2 generic arguments + two_type_params::(100); //~ ERROR function takes 2 generic arguments two_type_params::(100); } diff --git a/src/test/ui/suggestions/missing-type-param-used-in-param.rs b/src/test/ui/suggestions/missing-type-param-used-in-param.rs index 19286331b60..d444998d35b 100644 --- a/src/test/ui/suggestions/missing-type-param-used-in-param.rs +++ b/src/test/ui/suggestions/missing-type-param-used-in-param.rs @@ -3,6 +3,6 @@ fn two_type_params(_: B) {} fn main() { - two_type_params::(100); //~ ERROR this function takes 2 generic arguments + two_type_params::(100); //~ ERROR function takes 2 generic arguments two_type_params::(100); } diff --git a/src/test/ui/suggestions/sugg-else-for-closure.stderr b/src/test/ui/suggestions/sugg-else-for-closure.stderr index da4db46aad3..5f59d0f541c 100644 --- a/src/test/ui/suggestions/sugg-else-for-closure.stderr +++ b/src/test/ui/suggestions/sugg-else-for-closure.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure | | - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected reference `&str` found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr b/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr index 7583c875a1a..f520d88c6ba 100644 --- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr +++ b/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr @@ -78,7 +78,7 @@ error[E0308]: mismatched types LL | x.funk(3); | ---- ^ expected associated type, found integer | | - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected associated type `>::A` found type `{integer}` diff --git a/src/test/ui/traits/issue-52893.stderr b/src/test/ui/traits/issue-52893.stderr index 0ee44921bf5..7924d3db06f 100644 --- a/src/test/ui/traits/issue-52893.stderr +++ b/src/test/ui/traits/issue-52893.stderr @@ -7,7 +7,7 @@ LL | impl AddClass for Class

LL | builder.push(output); | ---- ^^^^^^ expected type parameter `F`, found struct `Class` | | - | arguments to this function are incorrect + | arguments to this method are incorrect | = note: expected type parameter `F` found struct `Class

` diff --git a/src/test/ui/tuple/add-tuple-within-arguments.rs b/src/test/ui/tuple/add-tuple-within-arguments.rs index 089c703fda5..01b13b29fb4 100644 --- a/src/test/ui/tuple/add-tuple-within-arguments.rs +++ b/src/test/ui/tuple/add-tuple-within-arguments.rs @@ -4,7 +4,7 @@ fn bar(s: &str, a: (&str,), s2: &str) {} fn main() { foo("hi", 1, 2, "hi"); - //~^ ERROR this function takes 3 arguments but 4 arguments were supplied + //~^ ERROR function takes 3 arguments but 4 arguments were supplied bar("hi", "hi", "hi"); //~^ ERROR mismatched types } diff --git a/src/test/ui/tuple/add-tuple-within-arguments.stderr b/src/test/ui/tuple/add-tuple-within-arguments.stderr index 7029d298d71..2e20a4cca08 100644 --- a/src/test/ui/tuple/add-tuple-within-arguments.stderr +++ b/src/test/ui/tuple/add-tuple-within-arguments.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 3 arguments but 4 arguments were supplied +error[E0061]: function takes 3 arguments but 4 arguments were supplied --> $DIR/add-tuple-within-arguments.rs:6:5 | LL | foo("hi", 1, 2, "hi"); diff --git a/src/test/ui/tuple/wrong_argument_ice-2.rs b/src/test/ui/tuple/wrong_argument_ice-2.rs index b0f814616f2..e1c1d748fec 100644 --- a/src/test/ui/tuple/wrong_argument_ice-2.rs +++ b/src/test/ui/tuple/wrong_argument_ice-2.rs @@ -11,7 +11,7 @@ impl Foo { fn bar() { let x = Foo; test(x.qux(), x.qux()); - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR function takes 1 argument but 2 arguments were supplied } fn main() {} diff --git a/src/test/ui/tuple/wrong_argument_ice-2.stderr b/src/test/ui/tuple/wrong_argument_ice-2.stderr index 0c2a4c41461..41244209214 100644 --- a/src/test/ui/tuple/wrong_argument_ice-2.stderr +++ b/src/test/ui/tuple/wrong_argument_ice-2.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: function takes 1 argument but 2 arguments were supplied --> $DIR/wrong_argument_ice-2.rs:13:5 | LL | test(x.qux(), x.qux()); diff --git a/src/test/ui/tuple/wrong_argument_ice-3.rs b/src/test/ui/tuple/wrong_argument_ice-3.rs index 951687c3759..96633180b57 100644 --- a/src/test/ui/tuple/wrong_argument_ice-3.rs +++ b/src/test/ui/tuple/wrong_argument_ice-3.rs @@ -7,7 +7,7 @@ fn test(process: &Process, groups: Vec) -> Vec { if groups.capacity() == 0 { groups.push(new_group, vec![process]); - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR this method takes 1 argument but 2 arguments were supplied return groups; } diff --git a/src/test/ui/tuple/wrong_argument_ice-3.stderr b/src/test/ui/tuple/wrong_argument_ice-3.stderr index fe3712ef839..0a503e1fe58 100644 --- a/src/test/ui/tuple/wrong_argument_ice-3.stderr +++ b/src/test/ui/tuple/wrong_argument_ice-3.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: this method takes 1 argument but 2 arguments were supplied --> $DIR/wrong_argument_ice-3.rs:9:16 | LL | groups.push(new_group, vec![process]); diff --git a/src/test/ui/tuple/wrong_argument_ice-4.rs b/src/test/ui/tuple/wrong_argument_ice-4.rs index 479bd0d819f..883d92dcce1 100644 --- a/src/test/ui/tuple/wrong_argument_ice-4.rs +++ b/src/test/ui/tuple/wrong_argument_ice-4.rs @@ -1,6 +1,6 @@ fn main() { (|| {})(|| { - //~^ ERROR this function takes 0 arguments but 1 argument was supplied + //~^ ERROR function takes 0 arguments but 1 argument was supplied let b = 1; }); } diff --git a/src/test/ui/tuple/wrong_argument_ice.rs b/src/test/ui/tuple/wrong_argument_ice.rs index da967d8c146..b7e0225feb7 100644 --- a/src/test/ui/tuple/wrong_argument_ice.rs +++ b/src/test/ui/tuple/wrong_argument_ice.rs @@ -9,7 +9,7 @@ pub struct BuildPlanBuilder { impl BuildPlanBuilder { pub fn or(&mut self) -> &mut Self { self.acc.push_back(self.current_provides, self.current_requires); - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR method takes 1 argument but 2 arguments were supplied self } } diff --git a/src/test/ui/tuple/wrong_argument_ice.stderr b/src/test/ui/tuple/wrong_argument_ice.stderr index 452413fc516..f1b00ae0b92 100644 --- a/src/test/ui/tuple/wrong_argument_ice.stderr +++ b/src/test/ui/tuple/wrong_argument_ice.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 1 argument but 2 arguments were supplied +error[E0061]: method takes 1 argument but 2 arguments were supplied --> $DIR/wrong_argument_ice.rs:11:18 | LL | self.acc.push_back(self.current_provides, self.current_requires); diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.rs b/src/test/ui/type/type-ascription-instead-of-initializer.rs index 9f9b6f06bbc..8978c85ed49 100644 --- a/src/test/ui/type/type-ascription-instead-of-initializer.rs +++ b/src/test/ui/type/type-ascription-instead-of-initializer.rs @@ -1,4 +1,4 @@ fn main() { let x: Vec::with_capacity(10, 20); //~ ERROR expected type, found `10` - //~^ ERROR this function takes 1 argument + //~^ ERROR function takes 1 argument } diff --git a/src/test/ui/typeck/remove-extra-argument.fixed b/src/test/ui/typeck/remove-extra-argument.fixed index a9338c76cdc..d09306bf794 100644 --- a/src/test/ui/typeck/remove-extra-argument.fixed +++ b/src/test/ui/typeck/remove-extra-argument.fixed @@ -4,6 +4,6 @@ fn l(_a: Vec) {} fn main() { l(vec![]) - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR function takes 1 argument but 2 arguments were supplied //~| HELP remove the extra argument } diff --git a/src/test/ui/typeck/remove-extra-argument.rs b/src/test/ui/typeck/remove-extra-argument.rs index 659cb8b267f..2181c37cee9 100644 --- a/src/test/ui/typeck/remove-extra-argument.rs +++ b/src/test/ui/typeck/remove-extra-argument.rs @@ -4,6 +4,6 @@ fn l(_a: Vec) {} fn main() { l(vec![], vec![]) - //~^ ERROR this function takes 1 argument but 2 arguments were supplied + //~^ ERROR function takes 1 argument but 2 arguments were supplied //~| HELP remove the extra argument }