about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-03 12:12:24 +0000
committerbors <bors@rust-lang.org>2014-11-03 12:12:24 +0000
commitb9b396cd7506c2e2aa6737adfa80f3404ed81b9d (patch)
treee623507b5799ba153b33c059e6b15a15cd5806ac /src/rustllvm/RustWrapper.cpp
parent851799d09e48e06f3fd0c4c6f694af51fc655f9a (diff)
parentfe256f81401e7af5fb3a3ec069427fd9c52073a9 (diff)
downloadrust-b9b396cd7506c2e2aa6737adfa80f3404ed81b9d.tar.gz
rust-b9b396cd7506c2e2aa6737adfa80f3404ed81b9d.zip
auto merge of #18463 : japaric/rust/bytes2, r=alexcrichton
- The `BytesContainer::container_into_owned_bytes` method has been removed

- Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path:

``` rust
Path::new("foo")  // Still works
path.join(another_path) -> path.join(&another_path)
```

[breaking-change]

---

Re: `container_into_owned_bytes`, I've removed it because

- Nothing in the whole repository uses it
- Takes `self` by value, which is incompatible with unsized types (`str`)

The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method.

Re: Breakage of `Path` methods

We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code.

r? @aturon 
cc #16918
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions