-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Possibly-incorrect coherence error with blanket impl bounded by a trait with type param #28881
Comments
cc me |
I believe the problem is that the negative reasoning you need is: struct Baz { }
impl Foo<Baz> for Bar<Baz> { }
impl Base for Baz { } I believe this does, in fact, pass the current orphan rules (at least if we adopted Covered First). Based on the table at the end, it seems to fall under the |
Ah, well. It's a little unfortunate if it is correctly rejected: this sort of blanket impl is useful in cases like (The concrete use-case I was thinking of was allowing all |
The issue here is rather that you can |
triage: From reading the last two comments from ariel and niko, this seems like it is expected behavior, and could be closed? |
@pnkfelix that seems right. I'd probably like to make a list of coherence failures though -- i.e., that we might use to validate negative reasoning designs and other things like that. Not sure where to put such a list, but it seems like this would be on it. |
I made an etherpad to collect these sorts of examples: https://public.etherpad-mozilla.org/p/rust-coherence-room-for-improvement After discussing in @rust-lang/lang mtg we agreed this is expected behavior, hence closing. |
This fails to compile:
Which is possibly a violation of the coherence RFC.
Notably, removing the parameter of
Base
compiles fine:The text was updated successfully, but these errors were encountered: