-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[DO NOT MERGE] Method receiver lint #152214
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
|
Error: Label needs-crater can only be set by Rust team members Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
Error: Label needs-crater can only be set by Rust team members Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
|
@rustbot label +I-lang-nominated |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
| let (impl_id, target_id) = find_impl_and_target_id(tcx, deref_trait, ty); | ||
| return Some(CheckResult { impl_plus_target: vec![(impl_id, target_id)] }); | ||
| } | ||
| if let Some(mut result) = check(tcx, infcx, typing_env, target_ty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like you could end up in an infinite loop, e.g.
impl Deref for StructA {
type Target = StructB;
}
impl Deref for StructB {
type Target = StructA;
}That doesn't matter for the crater run tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could use recursion limit: tcx.recursion_limit().value_within_limit(..)
|
@bors try |
This comment has been minimized.
This comment has been minimized.
[DO NOT MERGE] Method receiver lint
This is implementing the lint described in #151583. The plan is to run a crater run on this lint before deciding on how to add this to the language.
An important detail that I noticed when implementing was that it must recursively look at the target type. Since dereferencing to a concrete type that then derefs to a generic has the same problem.