]> git.lizzy.rs Git - rust.git/commit
Show types of all args when missing args
authorEsteban Küber <esteban@kuber.com.ar>
Wed, 1 Jun 2016 01:23:22 +0000 (18:23 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Thu, 16 Jun 2016 01:40:11 +0000 (18:40 -0700)
commit1020e3036badebc56b02661666b09a62112d04ec
tree175ef1c6bf37cd3afb0704fc180c123ee66f1539
parentad5fbaf57c1f763935175cd217fedfc551d91aac
Show types of all args when missing args

When there're missing arguments in a function call, present a list of
all the expected types:

```rust
fn main() {
    t("");
}

fn t(a: &str, x: String) {}
```

```bash
% rustc file.rs
file.rs:3:5: 2:8 error: this function takes 2 parameters but 0
parameters were supplied [E0061]
file.rs:3     t();
              ^~~
file.rs:3:5: 2:8 help: run `rustc --explain E0061` to see a detailed explanation
file.rs:3:5: 2:8 note: the following parameter types were expected: &str, std::string::String
error: aborting due to previous error
```

Fixes #33649
src/librustc_typeck/check/mod.rs
src/test/compile-fail/issue-18819.rs
src/test/compile-fail/issue-3044.rs
src/test/compile-fail/issue-4935.rs
src/test/compile-fail/method-call-err-msg.rs
src/test/compile-fail/not-enough-arguments.rs
src/test/compile-fail/overloaded-calls-bad.rs
src/test/compile-fail/variadic-ffi-3.rs