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), .. },
_,
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 {
} 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<Item = Ty<'tcx>>) -> bool {
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(),
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 {}
}
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
}
fn main() {
foo();
- //~^ ERROR this function takes 1 argument but 0 arguments were supplied
+ //~^ ERROR function takes 1 argument but 0 arguments were supplied
}
fn foo<T: Fn()>(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() {
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() {}
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
}
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,
""
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`
}
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]
) {}
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]
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
}
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: ()) -> () {}
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
}
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
}
fn main() {
(|_, ()| ())([return, ()]);
- //~^ ERROR this function takes 2 arguments but 1 argument was supplied
+ //~^ ERROR function takes 2 arguments but 1 argument was supplied
}
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
}
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
}
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
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
}
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
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
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
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
fn main() {
test::<2>();
- //~^ ERROR this function takes 2 generic arguments
+ //~^ ERROR function takes 2 generic arguments
}
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
}
fn main() {
let needlesArr: Vec<char> = 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
});
}
-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| {
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...
}
-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();
{}
fn main() {
- f(&[f()]); //~ ERROR this function takes 1 argument
+ f(&[f()]); //~ ERROR function takes 1 argument
}
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
}
| | |
| | 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<_>`
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!
}
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`
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
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]
LL | 1.query::<dyn ToString>("")
| --------------------- ^^ 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`
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::<usize>(); //~ ERROR this function takes 3 arguments but 0 arguments were supplied
+ y.three::<usize>(); //~ ERROR this method takes 3 arguments but 0 arguments were supplied
}
-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)
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()
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);
= 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::<usize>();
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
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
}
// 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;
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
}
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
}
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();
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::<()>();
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
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
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)) {
fn with_generic<T: Copy + Send>((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
}
}
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
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)) {
fn with_generic<T: Copy + Send>((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
}
}
-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);
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");
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);
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);
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);
fn two_type_params<A, B>(_: B) {}
fn main() {
- two_type_params::<String, _>(100); //~ ERROR this function takes 2 generic arguments
+ two_type_params::<String, _>(100); //~ ERROR function takes 2 generic arguments
two_type_params::<String, _>(100);
}
fn two_type_params<A, B>(_: B) {}
fn main() {
- two_type_params::<String>(100); //~ ERROR this function takes 2 generic arguments
+ two_type_params::<String>(100); //~ ERROR function takes 2 generic arguments
two_type_params::<String, _>(100);
}
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]`
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 `<T as Trait<i32>>::A`
found type `{integer}`
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<P>`
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
}
-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");
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() {}
-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());
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;
}
-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]);
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;
});
}
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
}
}
-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);
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
}
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
}
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
}