-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Inherent static methods can be called with a non-well-formed Self-type #28848
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
Comments
The root cause is that the substs of an inherent impl don't contain an entry for |
As we discussed briefly on IRC, I feel like logically the substs for an inherent impl ought to contain an entry for |
This no longer compiles with the following error, which I think means that this is fixed. Can someone confirm?
|
Yes, I think this has been fixed -- and the message confirms it. Probably we should be safe and add a test though, so marking as needs-test. |
Adding a regression test is an easy way to contribute to test! Simply add a file with a name like |
I would be interested in giving this a try. |
Go ahead! Let us know if there's anything we can do to help you out. |
Add test for Inherent static methods Fixes #28848
UPDATE: This has been fixed, but a test is still needed. See the comment below for instructions.
STR
Here a static method on
Foo
is called with unrelated lifetimes'a
and'b
, potentially violating the'b: 'a
bound. AsFoo::xmute
is not allowed to assumeFoo
is well-formed, this does not cause a soundness issue, but is still a potential back-compat hazard.cc @nikomatsakis
The text was updated successfully, but these errors were encountered: