Apply stricter orphan rules for traits with defaulted impls#23038
Merged
bors merged 4 commits intorust-lang:masterfrom Mar 10, 2015
Merged
Apply stricter orphan rules for traits with defaulted impls#23038bors merged 4 commits intorust-lang:masterfrom
bors merged 4 commits intorust-lang:masterfrom
Conversation
c579929 to
d81dab6
Compare
Contributor
There was a problem hiding this comment.
nit: can we make these 2 error messages consistent struct/enum vs struct or enum
Collaborator
|
☔ The latest upstream changes (presumably #23026) made this pull request unmergeable. Please resolve the merge conflicts. |
now have a simple set of trait def-ids. During coherence, we use a separate table to track the default impls for any given trait so that we can report a nice error. This fixes various bugs in the metadata encoding that led to `ty::trait_has_default_impl` yielding the wrong values in the cross-crate case. (In particular, default impl def-ids were not included in the list of all impl def-ids; I debated fixing just that, but this approach seemed cleaner overall, since we usually treat the "defaulted" bit on traits as being a property of the trait, and now iterating over a list of impls doesn't intermingle default impls with normal impls.)
since there are separate checks that apply to Copy (and Send uses the generic defaulted trait rules). Also prohibit `Sized` from being manually implemented for now.
d81dab6 to
4e789e0
Compare
Contributor
Author
|
@flaper87 I addressed your nits. Can you please r? the final commit, it's got new material. |
Contributor
There was a problem hiding this comment.
nit: negative impls aren't unsafe
Contributor
|
Couple of nits, otherwise, it looks good to me. |
Contributor
Author
Collaborator
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22978.
r? @flaper87