Uh oh!
There was an error while loading. Please reload this page.
DSTify [T]/str extension traits - #18291
Conversation
rust-highfive
commented
Oct 24, 2014
aturon
commented
Oct 27, 2014
OK, I've gone through the PR and it looks great to me. Thanks for taking this on! I'll r+ after a squash. |
japaric
commented
Oct 27, 2014
Squashed. @aturon re-r? |
This PR changes the signature of several methods from `foo(self, ...)` to `foo(&self, ...)`/`foo(&mut self, ...)`, but there is no breakage of the usage of these methods due to the autoref nature of `method.call()`s. This PR also removes the lifetime parameter from some traits (`Trait<'a>` -> `Trait`). These changes break any use of the extension traits for generic programming, but those traits are not meant to be used for generic programming in the first place. In the whole rust distribution there was only one misuse of a extension trait as a bound, which got corrected (the bound was unnecessary and got removed) as part of this PR. [breaking-change]
japaric
commented
Oct 28, 2014
@aturon Rebased. re-r? |
ftxqxd
commented
Oct 28, 2014
Should Perhaps slightly off-topic, but shouldn’t |
japaric
commented
Oct 28, 2014
I think UFCS still needs more work to do this, because traitBoxedSlice_<T> for Sized? {//fn into_vec_(Box<self>) -> Vec<T>; //~ error: expected identifier, found keyword `self`fninto_vec_(Box<Self>) -> Vec<T>;}impl<T>BoxedSlice_<T>for[T]{fninto_vec_(slice:Box<[T]>) -> Vec<T>{unimplemented!();}}fnmain(){let v:Box<[u8]> = box [0u8,1,2];println!("{}", v.into_vec_());//~^ error: type `Box<[u8]>` does not implement any method in scope named `into_vec_`}
I think the idea is to reduce the number of extension traits as much as possible (also see #16862), but I wasn't 100% sure so I didn't try that in this PR. |
aturon
commented
Oct 28, 2014
@P1start I plan to make a PR merging various extension traits and generally cleaning up the prelude traits after this PR lands. But it's fine to do the DST-ification first. |
ftxqxd
commented
Oct 28, 2014
This PR changes the signature of several methods from `foo(self, ...)` to `foo(&self, ...)`/`foo(&mut self, ...)`, but there is no breakage of the usage of these methods due to the autoref nature of `method.call()`s. This PR also removes the lifetime parameter from some traits (`Trait<'a>` -> `Trait`). These changes break any use of the extension traits for generic programming, but those traits are not meant to be used for generic programming in the first place. In the whole rust distribution there was only one misuse of a extension trait as a bound, which got corrected (the bound was unnecessary and got removed) as part of this PR. I've kept the commits as small and self-contained as possible for reviewing sake, but I can squash them when the review is over. See this [table] to get an idea of what's left to be done. I've already DSTified [`Show`][show] and I'm working on `Hash`, but bootstrapping those changes seem to require a more recent snapshot (#18259 does the trick) r? @aturon cc #16918 [show]: https://github.com/japaric/rust/commits/show [table]: https://docs.google.com/spreadsheets/d/1MZ_iSNuzsoqeS-mtLXnj9m0hBYaH5jI8k9G_Ud8FT5g/edit?usp=sharing
feat: respect references.exclude_tests in call-hierarchy closerust-lang#18212 ### Changes 1. feat: respect `references.exclude_tests` in call-hierarchy 2. Modified the description of `references.exclude_tests`
This PR changes the signature of several methods from
foo(self, ...)tofoo(&self, ...)/foo(&mut self, ...), but there is no breakage of the usage of these methods due to the autoref nature ofmethod.call()s. This PR also removes the lifetime parameter from some traits (Trait<'a>->Trait). These changes break any use of the extension traits for generic programming, but those traits are not meant to be used for generic programming in the first place. In the whole rust distribution there was only one misuse of a extension trait as a bound, which got corrected (the bound was unnecessary and got removed) as part of this PR.I've kept the commits as small and self-contained as possible for reviewing sake, but I can squash them when the review is over.
See this table to get an idea of what's left to be done. I've already DSTified
Showand I'm working onHash, but bootstrapping those changes seem to require a more recent snapshot (#18259 does the trick)r? @aturon
cc #16918