Skip to content

2021 prelude migration lint: Check if trait is actually implemented #86902

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

Closed
m-ou-se opened this issue Jul 6, 2021 · 4 comments · Fixed by #86904
Closed

2021 prelude migration lint: Check if trait is actually implemented #86902

m-ou-se opened this issue Jul 6, 2021 · 4 comments · Fixed by #86904
Assignees
Labels
A-edition-2021 Area: The 2021 edition D-edition Diagnostics: An error or lint that should account for edition differences. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Jul 6, 2021

(As I mentioned on Zulip:)

I tried out the migration lints on some of my own code, and ran into one false positive:

  • A StructOpt struct being used with Opt::from_iter
 help: disambiguate the associated function: `<Opt as StructOpt>::from_iter`

This doesn't actually become ambiguous when FromIterator is imported, because Opt doesn't implement that.


Niko said:

shouldn't be that hard, we just need a call to evaluate_predicate I think

@m-ou-se m-ou-se added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-edition Diagnostics: An error or lint that should account for edition differences. A-edition-2021 Area: The 2021 edition labels Jul 6, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jul 6, 2021

(If we don't end up doing this, we should at least change the wording to say "might become ambiguous" instead of "will ..".)

@m-ou-se
Copy link
Member Author

m-ou-se commented Jul 6, 2021

shouldn't be that hard, we just need a call to evaluate_predicate I think

@nikomatsakis Which exact function on which type do you mean? Do you have some pointers here?

@m-ou-se m-ou-se self-assigned this Jul 6, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jul 6, 2021

Okay I have an implementation that uh.. compiles. And seems to work, maybe? (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2021 Area: The 2021 edition D-edition Diagnostics: An error or lint that should account for edition differences. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants