We've long had traits `StrVector` and `VectorVector` providing
`concat`/`connect` and `concat_vec`/`connect_vec` respectively. The
reason for the distinction is that coherence rules did not used to be
robust enough to allow impls on e.g. `Vec<String>` versus `Vec<&[T]>`.
This commit consolidates the traits into a single `SliceConcatExt` trait
provided by `slice` and the preldue (where it replaces `StrVector`,
which is removed.)
[breaking-change]
This commit takes a second pass through the `vec` module to
stabilize its API. The changes are as follows:
**Stable**:
* `dedup`
* `from_raw_parts`
* `insert`
* `into_iter`
* `is_empty`
* `remove`
* `reserve_exact`
* `reserve`
* `retain`
* `swap_remove`
* `truncate`
**Deprecated**:
* `from_fn`, `from_elem`, `grow_fn` and `grow`, all deprecated in
favor of iterators. See https://github.com/rust-lang/rfcs/pull/509
* `partition`, `partitioned`, deprecated in favor of a new, more
general iterator consumer called `partition`.
* `unzip`, deprecated in favor of a new, more general iterator
consumer called `unzip`.
A few remaining methods are left at experimental status.
[breaking-change]
Rewrite associated types to use projection rather than dummy type parameters. This closes almost every (major) open issue, but I'm holding off on that until the code has landed and baked a bit. Probably it should have more tests, as well, but I wanted to get this landed as fast as possible so that we can collaborate on improving it.
The commit history is a little messy, particularly the merge commit at the end. If I get some time, I might just "reset" to the beginning and try to carve up the final state into logical pieces. Let me know if it seems hard to follow. By far the most crucial commit is "Implement associated type projection and normalization."
r? @nick29581
for lack of impl-trait-for-trait just a bit more targeted (don't
substitute err, just drop the troublesome bound for now) -- otherwise
substituting false types leads us into trouble when we normalize etc.
1. Produced more unique types than is necessary. This increases memory consumption.
2. Linking the type parameter to its definition *seems* like a good idea, but it
encourages reliance on the bounds listing.
3. It made pretty-printing harder and in particular was causing bad error messages
when errors occurred before the `TypeParameterDef` entries were fully stored.