about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-17 22:16:23 +0000
committerbors <bors@rust-lang.org>2014-07-17 22:16:23 +0000
commite288fc6a996562c5e4aca46e22c1da46eb3d086b (patch)
tree2f26793e5416aa2cef3b93760807543c0c6398d2 /src/liballoc
parent36d6acc4eea7e305058511c3fda19d459095b7f8 (diff)
parentde70d76373e05fcf0f421cedb185b08de10a714c (diff)
downloadrust-e288fc6a996562c5e4aca46e22c1da46eb3d086b.tar.gz
rust-e288fc6a996562c5e4aca46e22c1da46eb3d086b.zip
auto merge of #15515 : pcwalton/rust/cross-borrowing, r=alexcrichton
except where trait objects are involved.

Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.

This will break code like:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(a);

Change this code to:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(&*a);

[breaking-change]

r? @alexcrichton
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/boxed.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 56506d798d9..89f6e934ad2 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -67,7 +67,7 @@ impl<T:PartialEq> PartialEq for Box<T> {
 impl<T:PartialOrd> PartialOrd for Box<T> {
     #[inline]
     fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
-        (**self).partial_cmp(*other)
+        (**self).partial_cmp(&**other)
     }
     #[inline]
     fn lt(&self, other: &Box<T>) -> bool { *(*self) < *(*other) }
@@ -80,7 +80,9 @@ impl<T:PartialOrd> PartialOrd for Box<T> {
 }
 impl<T: Ord> Ord for Box<T> {
     #[inline]
-    fn cmp(&self, other: &Box<T>) -> Ordering { (**self).cmp(*other) }
+    fn cmp(&self, other: &Box<T>) -> Ordering {
+        (**self).cmp(&**other)
+    }
 }
 impl<T: Eq> Eq for Box<T> {}