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

Point at whole method call instead of args #46633

Merged
merged 2 commits into from
Dec 14, 2017
Merged

Conversation

estebank
Copy link
Contributor

To avoid confusion in cases where the code is

fn foo() {}
/ foo(
|     bar()
|     ^^^ current diagnostics point here for arg count mismatch
| );
|_^ new diagnostic span points here

as this leads to confusion making people think that the diagnostic is
talking about bar's arg count, not foo's.

Point at fns definition on arg mismatch, just like we do for closures.

Re #42855, Fix #45633.

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

To avoid confusion in cases where the code is

```rust
fn foo() {}
/ foo(
|     bar()
|     ^^^ current diagnostics point here for arg count mismatch
| );
|_^ new diagnostic span points here
```

as this leads to confusion making people think that the diagnostic is
talking about `bar`'s arg count, not `foo`'s.

Point at `fn`s definition on arg mismatch, just like we do for closures.
@estebank estebank added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 11, 2017
@arielb1
Copy link
Contributor

arielb1 commented Dec 13, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Dec 13, 2017

📌 Commit 92da913 has been approved by arielb1

@bors
Copy link
Contributor

bors commented Dec 13, 2017

🌲 The tree is currently closed for pull requests below priority 2, this pull request will be tested once the tree is reopened

@estebank estebank added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 13, 2017
@bors
Copy link
Contributor

bors commented Dec 14, 2017

⌛ Testing commit 92da913 with merge 75a02a9...

bors added a commit that referenced this pull request Dec 14, 2017
Point at whole method call instead of args

To avoid confusion in cases where the code is

```rust
fn foo() {}
/ foo(
|     bar()
|     ^^^ current diagnostics point here for arg count mismatch
| );
|_^ new diagnostic span points here
```

as this leads to confusion making people think that the diagnostic is
talking about `bar`'s arg count, not `foo`'s.

Point at `fn`s definition on arg mismatch, just like we do for closures.

Re #42855, Fix #45633.
@bors
Copy link
Contributor

bors commented Dec 14, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: arielb1
Pushing 75a02a9 to master...

@bors bors merged commit 92da913 into rust-lang:master Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants