-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Take 2: Implement object-safety and dynamic dispatch for arbitrary_self_types #54383
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
Merged
bors
merged 19 commits into
rust-lang:master
from
mikeyhew:custom-receivers-object-safety
Nov 3, 2018
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d14af13
Make all object-safety methods require a global TyCtxt
mikeyhew a920036
move some code around to avoid query cycles
mikeyhew be80a79
Add CoerceSized trait and lang item
mikeyhew d5c2c4a
Implement the object-safety checks for arbitrary_self_types: part 1
mikeyhew 9f59da2
Implement object-safety for arbitrary_self_types: part 2
mikeyhew 192900e
Add CoerceSized impls throughout libstd
mikeyhew a0f23f8
update tests that have changed output
mikeyhew 82f1f9a
Add new tests and update existing for object-safe custom receivers
mikeyhew c29641e
fix docs on trait
mikeyhew f12c250
Replace CoerceSized trait with DispatchFromDyn
mikeyhew 48d7f8d
update DispatchFromDyn doctest
mikeyhew 3c56d8d
fix error-index test
mikeyhew 74ef46c
Replace UncoeribleReceiver error message with UndispatchableReceiver
mikeyhew 6f2a161
Add layout sanity checks in object safety
mikeyhew b5b25f8
Put backticks around field names, types and paths in error messages
mikeyhew eb997d7
add `U: Trait` to the param env during DispatchFromDyn check
mikeyhew 3db2203
Remove this check for object-safety during selection of trait object …
mikeyhew a468da9
Add a check for reprs that could change the ABI
mikeyhew 192e7c4
Add comments explaining how codegen works for `dyn Trait` methods
mikeyhew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add CoerceSized trait and lang item
This trait is more-or-less the reverse of CoerceUnsized, and will be used for object-safety checks. Receiver types like `Rc` will have to implement `CoerceSized` so that methods that use `Rc<Self>` as the receiver will be considered object-safe.
- Loading branch information
commit be80a79a1ea247a71e5ffa408356b9b72cddb644
There are no files selected for viewing
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
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
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
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.
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.
So, we need to rename this, per @eddyb's suggestion