Skip to content

Remind the programmer to use () for method calls - #12937

Merged
bors merged 1 commit into
rust-lang:masterfrom
sinistersnare:method-error-message
Mar 17, 2014
Merged

Remind the programmer to use () for method calls#12937
bors merged 1 commit into
rust-lang:masterfrom
sinistersnare:method-error-message

Conversation

@sinistersnare

Copy link
Copy Markdown
Contributor

its a common (yet easily fixable) error to just forget parens at the end of getter-like methods without any arguments.

The current error message for that case asks for an anonymous function, this patch adds a note asking for either an anonymous function, or for trailing parens.

This is my first contribution! do i need to do anything else?

@sinistersnare

Copy link
Copy Markdown
ContributorAuthor

How is "maybe a missing () to call it? If not, try writing an anonymous function"

the parens are wrapped in backticks, but github escaping kinda sucks.

@huonw

Copy link
Copy Markdown
Contributor

@sinistersnare That's good.

@sinistersnare

Copy link
Copy Markdown
ContributorAuthor

OK, added test. I think this is good. r?

bors added a commit that referenced this pull request Mar 17, 2014
its a common (yet easily fixable) error to just forget parens at the end of getter-like methods without any arguments.
The current error message for that case asks for an anonymous function, this patch adds a note asking for either an anonymous function, or for trailing parens.
This is my first contribution! do i need to do anything else?
@borsbors closed this Mar 17, 2014
@bors
bors merged commit 8b6592e into rust-lang:masterMar 17, 2014
@sinistersnare

Copy link
Copy Markdown
ContributorAuthor

Thanks so much @huonw for the help! That was awesome!

@sinistersnare
sinistersnare deleted the method-error-message branch March 17, 2014 02:27
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 16, 2022
Add fixups for incomplete in proc-macros
Partially implements rust-lang/rust-analyzer#12777.
Added support for for loops and match statements.
I couldn't do paths like `crate::foo::` as I wasn't able to add `SyntheticTokens` to the end of `foo::`, they always ended up after `crate::`
This is my first contribution so please don't be shy about letting me know if I've done anything wrong!
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 27, 2024
…r_comparison, r=Alexendoo
Add MSRV for manual_pattern_char_comparison
Fixesrust-lang#12936
changelog: [`manual_pattern_char_comparison`]: Add MSRV 1.58
Sign up for freeto 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.

3 participants

@sinistersnare@huonw@bors