diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-02-05 21:08:07 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-02-11 12:42:00 -0800 |
| commit | 683ebc2dec0a5b88eb3eaf146e6855ea299d17b8 (patch) | |
| tree | 34406a93baacf0175755a5be55953b6af74369b4 /src/test/ui/methods/method-call-err-msg.rs | |
| parent | a19edd6b161521a4f66716b3b45b8cf4d3f03f3a (diff) | |
| download | rust-683ebc2dec0a5b88eb3eaf146e6855ea299d17b8.tar.gz rust-683ebc2dec0a5b88eb3eaf146e6855ea299d17b8.zip | |
On mismatched argument count point at arguments
Diffstat (limited to 'src/test/ui/methods/method-call-err-msg.rs')
| -rw-r--r-- | src/test/ui/methods/method-call-err-msg.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/ui/methods/method-call-err-msg.rs b/src/test/ui/methods/method-call-err-msg.rs index 5ff4b412667..9bfacc7babf 100644 --- a/src/test/ui/methods/method-call-err-msg.rs +++ b/src/test/ui/methods/method-call-err-msg.rs @@ -5,16 +5,18 @@ impl Foo { fn zero(self) -> Foo { self } fn one(self, _: isize) -> Foo { self } fn two(self, _: isize, _: isize) -> Foo { self } + fn three<T>(self, _: T, _: T, _: T) -> Foo { self } } fn main() { let x = Foo; - x.zero(0) //~ ERROR this function takes 0 parameters but 1 parameter was supplied - .one() //~ ERROR this function takes 1 parameter but 0 parameters were supplied - .two(0); //~ ERROR this function takes 2 parameters but 1 parameter was supplied + 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 let y = Foo; y.zero() .take() //~ ERROR no method named `take` found .one(0); + y.three::<usize>(); //~ ERROR this function takes 3 arguments but 0 arguments were supplied } |
