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

[use_self] fix suggestion when full path to struct was given #9726

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

kraktus
Copy link
Contributor

@kraktus kraktus commented Oct 26, 2022

Previously the following wrong suggestion was given

impl Error for std::fmt::Error {
    fn custom<T: std::fmt::Display>(_msg: T) -> Self {
-        std::fmt::Error // Should lint
+        Self::Error // Should lint
    }
}

Also remove known problem line related to #4140 since it's been closed, and refactor the lint

changelog: [use_self] fix suggestion when full path to struct was given

@rust-highfive
Copy link

r? @Alexendoo

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 26, 2022
@kraktus kraktus changed the title [use_self] fix FP when full path to struct was given [use_self] fix suggestion when full path to struct was given Oct 26, 2022
Previously the following wrong suggestion was given

```rust
impl Error for std::fmt::Error {
    fn custom<T: std::fmt::Display>(_msg: T) -> Self {
-        std::fmt::Error // Should lint
+        Self::Error // Should lint
    }
}
```

Also remove known problem line related to rust-lang#4140 since it's been closed, and refactor the lint
@Alexendoo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 27, 2022

📌 Commit 1909a6a has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 27, 2022

⌛ Testing commit 1909a6a with merge 4326814...

@bors
Copy link
Contributor

bors commented Oct 27, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 4326814 to master...

@bors bors merged commit 4326814 into rust-lang:master Oct 27, 2022
@kraktus kraktus mentioned this pull request Oct 28, 2022
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