Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ICE for mismatched args on target without span #48047

Merged
merged 1 commit into from
Feb 10, 2018
Merged

Fix ICE for mismatched args on target without span #48047

merged 1 commit into from
Feb 10, 2018

Commits on Feb 7, 2018

  1. Fix ICE for mismatched args on target without span

    Commit 7ed00ca improved our error reporting by including the target
    function in our error messages when there is an argument count mismatch.
    A simple example from the UI tests is:
    
    ```
    error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
      --> $DIR/closure-arg-count.rs:32:53
       |
    32 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
       |                                                     ^^^ expected function that takes a single 2-tuple as argument
    ...
    44 | fn foo() {}
       | -------- takes 0 arguments
    ```
    
    However, this assumed the target span was always available. This does
    not hold true if the target function is in `std` or another crate. A
    simple example from #48046 is assigning `str::split` to a function type
    with a different number of arguments.
    
    Fix by removing all of the labels and suggestions related to the target
    span when it's not found.
    
    Fixes #48046
    etaoins committed Feb 7, 2018
    Configuration menu
    Copy the full SHA
    daaa9a4 View commit details
    Browse the repository at this point in the history