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

Add note if method is called on a function object #32358

Merged
merged 5 commits into from
Mar 20, 2016

Conversation

Manishearth
Copy link
Member

rebase of #32053

Daniel J Rollins added 5 commits March 19, 2016 22:06
Fixes issue rust-lang#29124.

If method is called on a function type a note is generated to suggest
that the developer may have forgotten to call it.

e.g.

fn main() {
    let mut guess = String::new();
    std::io::stdin.read_line(&mut guess);
}

will generate the note:

note: called method on function type. did you mean `std::io::stdin().read_line(..)`?
Split `fileline_note` into a `file_line note` and `span_suggestion` as per
@Manishearth's suggestions.

Change nested `match`es to `if let`s.
@rust-highfive
Copy link
Collaborator

r? @arielb1

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

@Manishearth
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Mar 19, 2016

📌 Commit 88ad229 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Mar 20, 2016

⌛ Testing commit 88ad229 with merge b6fcab5...

bors added a commit that referenced this pull request Mar 20, 2016
Add note if method is called on a function object

rebase of #32053
@bors bors merged commit 88ad229 into rust-lang:master Mar 20, 2016
@Manishearth Manishearth deleted the pr-32053 branch March 20, 2016 09:00
@Manishearth
Copy link
Member Author

This merged. Thanks, @djrollins!

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 1, 2016
…arth

Remove accidental `println!`

This removes a use of `println!` added in rust-lang#32358 that appears to accidental.
r? @Manishearth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants