-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #18638 : aturon/rust/as_slice_dst, r=japaric
This PR changes `AsSlice` to work on unsized types, and changes the `impl` for `&[T]` to `[T]`. Aside from making the trait more general, this also helps some ongoing work with method resolution changes. This is a breaking change: code that uses generics bounded by `AsSlice` will have to change. In particular, such code previously often took arguments of type `V` where `V: AsSlice<T>` by value. These should now be taken by reference: ```rust fn foo<Sized? V: AsSlice<T>>(v: &V) { .. } ``` A few std lib functions have been changed accordingly. The PR also relaxes constraints on generics and traits within the `core::ops` module and for the `Equiv` trait. [breaking-change] r? @nikomatsakis cc @japaric
- Loading branch information
Showing
7 changed files
with
42 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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