about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-07 04:14:22 +0000
committerbors <bors@rust-lang.org>2015-02-07 04:14:22 +0000
commit0b6dbbc9cfb747df1db646bba16561c022704056 (patch)
tree1b6bf9780361f2cd8bce65f44a1a5727676d1c6b /src/libstd/sys/unix/stack_overflow.rs
parent7ebf9bc5c22155d622537ded42b4ebf94238b296 (diff)
parent724bf7bce2b35ac5731cf7e217c0e87916517b69 (diff)
downloadrust-0b6dbbc9cfb747df1db646bba16561c022704056.tar.gz
rust-0b6dbbc9cfb747df1db646bba16561c022704056.zip
Auto merge of #21949 - japaric:index, r=nikomatsakis
closes #21630

Overloaded indexing (`&[mut] foo[bar]`) only works when `<Self as Index>::Output` is the same as `<Self as IndexMut>::Output` (see issue above). To restrict implementations of `IndexMut` that doesn't work, this PR makes `IndexMut` a supertrait over `Index`, i.e. `trait IndexMut<I>: Index<I>`, just like in the `trait DerefMut: Deref` case.

This breaks all downstream implementations of `IndexMut`, in most cases this simply means removing the `type Output = ..` bit, which is now redundant, from `IndexMut` implementations:

``` diff
 impl Index<Foo> for Bar {
     type Output = Baz;
     ..
 }

 impl IndexMut<Foo> for Bar {
-    type Output = Baz;
     ..
 }
```

[breaking-change]

---

r? @nikomatsakis 
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions