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

Make lexical_region_resolve public for Clippy #87989

Closed
wants to merge 1 commit into from

Conversation

camsteffen
Copy link
Contributor

I have a locally working fix for rust-lang/rust-clippy#4002 that involves lexical_region_resolve::resolve. I'm doing my best to understand region checking and how it should integrate with Clippy, so please tell me if I'm totally on the wrong path. Basically I need to construct and evaluate a TypeOutlives obligation.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 Aug 12, 2021
@camsteffen
Copy link
Contributor Author

I wonder if the Cilppy suggestion should compile though? Isn't any A::b 'static as long as it is a function pointer?

@petrochenkov
Copy link
Contributor

If something is public only for clippy, then it probably should have a comment saying that it's public only for clippy.

Regarding other questions, r? @jackh726 maybe.

@inquisitivecrystal inquisitivecrystal added A-clippy Area: Clippy T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 24, 2021
@camsteffen
Copy link
Contributor Author

After looking at this again, I think this is wrong. But there may be an opportunity to improve rustc coercion. I found out that take(G::f as fn(Arg)) works.

@jackh726
Copy link
Member

I still need to take some time to look at this. I'll try to do that soon.

@jackh726
Copy link
Member

@camsteffen do you still need this to be public? If so, do you have a branch I can look at?

@jackh726
Copy link
Member

If you still need this, I think r=me with an appropriate comment

@jackh726 jackh726 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2021
@camsteffen
Copy link
Contributor Author

I decided not to go this route. I just opened rust-lang/rust-clippy#7661 with a workaround for the Clippy bug - I just ignore associated functions on type parameters. I'm fairly certain this is an issue with rustc coercion so I don't think it makes sense to add this complexity to Clippy to work around a rustc bug.

@camsteffen camsteffen closed this Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-clippy Area: Clippy S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants