diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/mismatched_types/overloaded-calls-bad.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/mismatched_types/overloaded-calls-bad.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/tuple/wrong_argument_ice-2.rs | 17 | ||||
| -rw-r--r-- | src/test/ui/tuple/wrong_argument_ice-2.stderr | 19 |
4 files changed, 37 insertions, 8 deletions
diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.rs b/src/test/ui/mismatched_types/overloaded-calls-bad.rs index d62625faaaa..902a6ec81d6 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.rs +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.rs @@ -30,5 +30,4 @@ fn main() { //~^ ERROR this 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 mismatched types } diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index 9ae9c474162..264d7cbb9b1 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -18,12 +18,6 @@ note: associated function defined here LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; | ^^^^^^^^ -error[E0308]: mismatched types - --> $DIR/overloaded-calls-bad.rs:31:17 - | -LL | let ans = s("burma", "shave"); - | ^^^^^^^ expected `isize`, found `&str` - error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/overloaded-calls-bad.rs:31:15 | @@ -38,7 +32,7 @@ note: associated function defined here LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; | ^^^^^^^^ -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors Some errors have detailed explanations: E0057, E0308. For more information about an error, try `rustc --explain E0057`. diff --git a/src/test/ui/tuple/wrong_argument_ice-2.rs b/src/test/ui/tuple/wrong_argument_ice-2.rs new file mode 100644 index 00000000000..b0f814616f2 --- /dev/null +++ b/src/test/ui/tuple/wrong_argument_ice-2.rs @@ -0,0 +1,17 @@ +fn test(t: (i32, i32)) {} + +struct Foo; + +impl Foo { + fn qux(&self) -> i32 { + 0 + } +} + +fn bar() { + let x = Foo; + test(x.qux(), x.qux()); + //~^ ERROR this 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 new file mode 100644 index 00000000000..ddafc9763e7 --- /dev/null +++ b/src/test/ui/tuple/wrong_argument_ice-2.stderr @@ -0,0 +1,19 @@ +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/wrong_argument_ice-2.rs:13:5 + | +LL | test(x.qux(), x.qux()); + | ^^^^ ------- ------- supplied 2 arguments + | +note: function defined here + --> $DIR/wrong_argument_ice-2.rs:1:4 + | +LL | fn test(t: (i32, i32)) {} + | ^^^^ ------------- +help: use parentheses to construct a tuple + | +LL | test((x.qux(), x.qux())); + | + + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0061`. |
