Skip to content

Fix use_self false positive on nested functions #3869

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

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Mar 11, 2019

Related to #3640

The current use_self warns the following code.

#![warn(clippy::use_self)]
struct Foo {}
impl Foo {
    fn bar() {
        fn baz() -> Foo { //^ warning: unnecessary structure name repetition
            Foo {} //^ warning: unnecessary structure name repetition
         }
    }
}

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 12, 2019
@flip1995
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 12, 2019

📌 Commit 187ce4c has been approved by flip1995

bors added a commit that referenced this pull request Mar 12, 2019
Fix `use_self` false positive on nested functions

Related to #3640

The current `use_self` warns the following code.

```rust
#![warn(clippy::use_self)]
struct Foo {}
impl Foo {
    fn bar() {
        fn baz() -> Foo { //^ warning: unnecessary structure name repetition
            Foo {} //^ warning: unnecessary structure name repetition
         }
    }
}
```
@bors
Copy link
Contributor

bors commented Mar 12, 2019

⌛ Testing commit 187ce4c with merge 8fc0a73...

@bors
Copy link
Contributor

bors commented Mar 12, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing 8fc0a73 to master...

@bors bors merged commit 187ce4c into rust-lang:master Mar 12, 2019
@taiki-e taiki-e deleted the use_self branch March 12, 2019 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants