Skip to content

Commit b388344

Browse files
committed
---
yaml --- r: 96253 b: refs/heads/dist-snap c: fdac9e4 h: refs/heads/master i: 96251: 35d4acf v: v3
1 parent 4ed5b07 commit b388344

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: ae91b81a6f7cba76d94ce00ef8155b9550344929
9+
refs/heads/dist-snap: fdac9e470cd87429b6aefc6e02772163a8d41fc8
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,10 +1099,9 @@ pub fn link_args(sess: Session,
10991099
// and binutils 2.22+ won't add them automatically
11001100
if sess.targ_cfg.os == abi::OsLinux {
11011101
// GNU-style linkers supports optimization with -O. --gc-sections removes metadata and
1102-
// potentially other useful things, so don't include it. GNU ld doesn't need a numeric
1103-
// argument, but other linkers do.
1102+
// potentially other useful things, so don't include it.
11041103
if sess.opts.optimize == session::Default || sess.opts.optimize == session::Aggressive {
1105-
args.push(~"-Wl,-O1");
1104+
args.push(~"-Wl,-O");
11061105
}
11071106

11081107
args.push_all([~"-lrt", ~"-ldl"]);

branches/dist-snap/src/libstd/rc.rs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use ops::Drop;
2222
use kinds::{Freeze, Send};
2323
use clone::{Clone, DeepClone};
2424
use cell::RefCell;
25+
use cmp::{Eq, TotalEq, Ord, TotalOrd, Ordering};
2526

2627
struct RcBox<T> {
2728
value: T,
@@ -80,6 +81,60 @@ impl<T> Rc<T> {
8081
pub fn borrow<'r>(&'r self) -> &'r T {
8182
unsafe { &(*self.ptr).value }
8283
}
84+
85+
/// Determine if two reference-counted pointers point to the same object
86+
#[inline]
87+
pub fn ptr_eq(&self, other: &Rc<T>) -> bool {
88+
self.ptr == other.ptr
89+
}
90+
}
91+
92+
impl<T: Eq> Eq for Rc<T> {
93+
#[inline]
94+
fn eq(&self, other: &Rc<T>) -> bool {
95+
unsafe { (*self.ptr).value == (*other.ptr).value }
96+
}
97+
98+
#[inline]
99+
fn ne(&self, other: &Rc<T>) -> bool {
100+
unsafe { (*self.ptr).value != (*other.ptr).value }
101+
}
102+
}
103+
104+
impl<T: TotalEq> TotalEq for Rc<T> {
105+
#[inline]
106+
fn equals(&self, other: &Rc<T>) -> bool {
107+
unsafe { (*self.ptr).value.equals(&(*other.ptr).value) }
108+
}
109+
}
110+
111+
impl<T: Ord> Ord for Rc<T> {
112+
#[inline]
113+
fn lt(&self, other: &Rc<T>) -> bool {
114+
unsafe { (*self.ptr).value < (*other.ptr).value }
115+
}
116+
117+
#[inline]
118+
fn le(&self, other: &Rc<T>) -> bool {
119+
unsafe { (*self.ptr).value <= (*other.ptr).value }
120+
}
121+
122+
#[inline]
123+
fn ge(&self, other: &Rc<T>) -> bool {
124+
unsafe { (*self.ptr).value >= (*other.ptr).value }
125+
}
126+
127+
#[inline]
128+
fn gt(&self, other: &Rc<T>) -> bool {
129+
unsafe { (*self.ptr).value > (*other.ptr).value }
130+
}
131+
}
132+
133+
impl<T: TotalOrd> TotalOrd for Rc<T> {
134+
#[inline]
135+
fn cmp(&self, other: &Rc<T>) -> Ordering {
136+
unsafe { (*self.ptr).value.cmp(&(*other.ptr).value) }
137+
}
83138
}
84139

85140
impl<T> Clone for Rc<T> {

0 commit comments

Comments
 (0)