diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 15:34:32 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 15:34:48 -0800 |
| commit | 2cdbd288ac0606902885434e1ccd8d8bde68913d (patch) | |
| tree | 9a7d37f7dd44424182797c76d49ba0ece99f9513 /src/libsyntax/util | |
| parent | 365bd9a9e3b9dafa98e26982353fd28a6ca1efef (diff) | |
| parent | a99e698628cbd396c8100ef776d10ac61d911847 (diff) | |
| download | rust-2cdbd288ac0606902885434e1ccd8d8bde68913d.tar.gz rust-2cdbd288ac0606902885434e1ccd8d8bde68913d.zip | |
rollup merge of #22210: aturon/stab-final-borrow
Conflicts: src/libcollections/btree/map.rs src/libcollections/str.rs src/libcollections/vec.rs src/libcore/borrow.rs src/libcore/hash/mod.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/interner.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 58b5c44c960..2e8f43be120 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -14,7 +14,7 @@ use ast::Name; -use std::borrow::BorrowFrom; +use std::borrow::Borrow; use std::cell::RefCell; use std::cmp::Ordering; use std::collections::HashMap; @@ -80,7 +80,7 @@ impl<T: Eq + Hash<Hasher> + Clone + 'static> Interner<T> { } pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name> - where Q: BorrowFrom<T> + Eq + Hash<Hasher> { + where T: Borrow<Q>, Q: Eq + Hash<Hasher> { let map = self.map.borrow(); match (*map).get(val) { Some(v) => Some(*v), @@ -193,9 +193,9 @@ impl fmt::Display for RcStr { } } -impl BorrowFrom<RcStr> for str { - fn borrow_from(owned: &RcStr) -> &str { - &owned.string[] +impl Borrow<str> for RcStr { + fn borrow(&self) -> &str { + &self.string[] } } @@ -277,7 +277,7 @@ impl StrInterner { #[cfg(stage0)] pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name> - where Q: BorrowFrom<RcStr> + Eq + Hash<Hasher> { + where RcStr: Borrow<Q>, Q: Eq + Hash<Hasher> { match (*self.map.borrow()).get(val) { Some(v) => Some(*v), None => None, |
