-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Tracking issue for enforcing object safety when coercing to an object #17670
Comments
nominating for 1.0, p-backcompat-lang |
cc @nikomatsakis (assigned to merge the RFC PR) |
Note for the future - I expect when we do the DST extension to trait objects we will also need to check here for some properties of associated types - that they don't include generics or Self, probably - not sure how this interacts with binding the associated types in a trait object's type though. I should check the assoc. types RFC... |
I believe that object types must spell out the values of all associated types, at least for now. Niko -------- Original message -------- Note for the future - I expect when we do the DST extension to trait objects we will also need to check here for some properties of associated types - that they don't include generics or Self, probably - not sure how this interacts with binding the associated types in a trait object's type though. I should check the assoc. types RFC... — |
This seems like just a loss in flexibility without us really gaining much. Now we will have to split up traits that used to be simple into many small pieces just to avoid this restriction. |
cc #17704 |
(leaving nominated for a week while the debate gets hashed out e.g on PR #17704 ) |
leaving nominated until hopefully the weekly meeting next week. |
See http://discuss.rust-lang.org/t/feedback-wanted-trait-objects-with-generic-self-methods/606 and http://www.reddit.com/r/rust/comments/2ihu40/feedback_wanted_trait_objects_with_generic_or/ for discussion. We're going to try to resolve this at the next weekly meeting. |
Assigning 1.0, P-backcompat-lang. |
closes rust-lang#17670 [breaking-change] Traits must be object-safe if they are to be used in trait objects. This might require splitting a trait into object-safe and non-object-safe parts. Some standard library traits in std::io have been split - Reader has new traits BytesReader (for the bytes method) and AsRefReader (for by_ref), Writer has new trait AsRefWriter (for by_ref). All these new traits have blanket impls, so any type which implements Reader or Writer (respectively) will have an implmentation of the new traits. To fix your code, you just need to `use` the new trait.
LRU `body_with_source_map` query This query is being invalidated all the time anyways (we have an extra query on top of it for the body incrementality that is not source dependent), so there is little reason to keep these around all the time when only some IDE features are interested in them.
LRU `body_with_source_map` query This query is being invalidated all the time anyways (we have an extra query on top of it for the body incrementality that is not source dependent), so there is little reason to keep these around all the time when only some IDE features are interested in them.
RFC PR: rust-lang/rfcs#255
The text was updated successfully, but these errors were encountered: