]> git.lizzy.rs Git - rust.git/commit
rollup merge of #18910: aturon/borrow-traits
authorJakub Bukaj <jakub@jakub.cc>
Mon, 17 Nov 2014 23:23:53 +0000 (00:23 +0100)
committerJakub Bukaj <jakub@jakub.cc>
Mon, 17 Nov 2014 23:23:53 +0000 (00:23 +0100)
commit7137c2cc83526e1f74af472380e625fc7c552826
treecc7b9988bd93f775a5caa1be85c4bbf4eeb60662
parentfcf9fb61574a415653fa0c787058972312ce1235
parent46be8eb47ccd261ecb00ba25e0c24f28c8af75d7
rollup merge of #18910: aturon/borrow-traits

Following [the collections reform RFC](https://github.com/rust-lang/rfcs/pull/235), this PR:

* Adds a new `borrow` module to libcore. The module contains traits for borrowing data (`BorrowFrom` and `BorrowFromMut`), generalized cloning (`ToOwned`), and a clone-on-write smartpointer (`Cow`).

* Deprecates the `_equiv` family of methods on `HashMap` and `HashSet` by instead generalizing the "normal" methods like `get` and `remove` to use the new `std::borrow` infrastructure.

* Generalizes `TreeMap`, `TreeSet`, `BTreeMap` and `BTreeSet` to use the new `std::borrow` infrastructure for lookups.

[breaking-change]
src/librustc/middle/trans/base.rs