Skip to content

Commit 73af493

Browse files
committed
---
yaml --- r: 95070 b: refs/heads/dist-snap c: 7e709bf h: refs/heads/master v: v3
1 parent 41b2f39 commit 73af493

37 files changed

+425
-422
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: a8ba31dbf3e7d80a069bc486a35eff8357282b68
9+
refs/heads/dist-snap: 7e709bfd0dac1d5bbe5c97494980731b4d477e8f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/arc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl<T:Send> MutexArc<T> {
255255
let inner = x.unwrap();
256256
let MutexArcInner { failed: failed, data: data, _ } = inner;
257257
if failed {
258-
fail!(~"Can't unwrap poisoned MutexArc - another task failed inside!");
258+
fail2!("Can't unwrap poisoned MutexArc - another task failed inside!");
259259
}
260260
data
261261
}
@@ -300,9 +300,9 @@ impl<T:Freeze + Send> MutexArc<T> {
300300
fn check_poison(is_mutex: bool, failed: bool) {
301301
if failed {
302302
if is_mutex {
303-
fail!("Poisoned MutexArc - another task failed inside!");
303+
fail2!("Poisoned MutexArc - another task failed inside!");
304304
} else {
305-
fail!("Poisoned rw_arc - another task failed inside!");
305+
fail2!("Poisoned rw_arc - another task failed inside!");
306306
}
307307
}
308308
}
@@ -505,7 +505,7 @@ impl<T:Freeze + Send> RWArc<T> {
505505
let inner = x.unwrap();
506506
let RWArcInner { failed: failed, data: data, _ } = inner;
507507
if failed {
508-
fail!(~"Can't unwrap poisoned RWArc - another task failed inside!")
508+
fail2!(~"Can't unwrap poisoned RWArc - another task failed inside!")
509509
}
510510
data
511511
}
@@ -619,7 +619,7 @@ mod tests {
619619
assert_eq!(arc_v.get()[2], 3);
620620
assert_eq!(arc_v.get()[4], 5);
621621
622-
info!(arc_v);
622+
info2!("{:?}", arc_v);
623623
}
624624
625625
#[test]

branches/dist-snap/src/libextra/arena.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
127127

128128
let start = round_up_to(after_tydesc, align);
129129

130-
//debug!("freeing object: idx = %u, size = %u, align = %u, done = %b",
130+
//debug2!("freeing object: idx = {}, size = {}, align = {}, done = {}",
131131
// start, size, align, is_done);
132132
if is_done {
133133
((*tydesc).drop_glue)(ptr::offset(buf, start as int) as *i8);
@@ -176,7 +176,7 @@ impl Arena {
176176
}
177177
this.pod_head.fill = end;
178178

179-
//debug!("idx = %u, size = %u, align = %u, fill = %u",
179+
//debug2!("idx = {}, size = {}, align = {}, fill = {}",
180180
// start, n_bytes, align, head.fill);
181181

182182
ptr::offset(vec::raw::to_ptr(this.pod_head.data), start as int)
@@ -232,7 +232,7 @@ impl Arena {
232232
let head = transmute_mut_region(&mut self.head);
233233
head.fill = round_up_to(end, sys::pref_align_of::<*TyDesc>());
234234

235-
//debug!("idx = %u, size = %u, align = %u, fill = %u",
235+
//debug2!("idx = {}, size = {}, align = {}, fill = {}",
236236
// start, n_bytes, align, head.fill);
237237

238238
let buf = vec::raw::to_ptr(self.head.data);
@@ -305,6 +305,6 @@ fn test_arena_destructors_fail() {
305305
// Now, fail while allocating
306306
do arena.alloc::<@int> {
307307
// Now fail.
308-
fail!();
308+
fail2!();
309309
};
310310
}

branches/dist-snap/src/libextra/base64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'self> ToBase64 for &'self [u8] {
141141
v.push('=' as u8);
142142
}
143143
}
144-
_ => fail!("Algebra is broken, please alert the math police")
144+
_ => fail2!("Algebra is broken, please alert the math police")
145145
}
146146

147147
unsafe {
@@ -202,7 +202,7 @@ impl<'self> FromBase64 for &'self str {
202202
'/'|'_' => buf |= 0x3F,
203203
'\r'|'\n' => loop,
204204
'=' => break,
205-
_ => return Err(fmt!("Invalid character '%c' at position %u",
205+
_ => return Err(format!("Invalid character '{}' at position {}",
206206
self.char_at(idx), idx))
207207
}
208208

@@ -218,7 +218,7 @@ impl<'self> FromBase64 for &'self str {
218218

219219
for (idx, byte) in it {
220220
if (byte as char) != '=' {
221-
return Err(fmt!("Invalid character '%c' at position %u",
221+
return Err(format!("Invalid character '{}' at position {}",
222222
self.char_at(idx), idx));
223223
}
224224
}

branches/dist-snap/src/libextra/bitv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pub struct Bitv {
232232
}
233233

234234
fn die() -> ! {
235-
fail!("Tried to do operation on bit vectors with different sizes");
235+
fail2!("Tried to do operation on bit vectors with different sizes");
236236
}
237237

238238
impl Bitv {
@@ -1357,7 +1357,7 @@ mod tests {
13571357
let mut b = Bitv::new(14, true);
13581358
b.clear();
13591359
do b.ones |i| {
1360-
fail!("found 1 at %?", i)
1360+
fail2!("found 1 at {:?}", i)
13611361
};
13621362
}
13631363
@@ -1366,7 +1366,7 @@ mod tests {
13661366
let mut b = Bitv::new(140, true);
13671367
b.clear();
13681368
do b.ones |i| {
1369-
fail!("found 1 at %?", i)
1369+
fail2!("found 1 at {:?}", i)
13701370
};
13711371
}
13721372

branches/dist-snap/src/libextra/comm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ mod test {
179179
let (port, chan) = rendezvous();
180180
do spawn_unlinked {
181181
chan.duplex_stream.send(()); // Can't access this field outside this module
182-
fail!()
182+
fail2!()
183183
}
184184
port.recv()
185185
}
@@ -189,7 +189,7 @@ mod test {
189189
let (port, chan) = rendezvous();
190190
do spawn_unlinked {
191191
port.duplex_stream.recv();
192-
fail!()
192+
fail2!()
193193
}
194194
chan.try_send(());
195195
}
@@ -200,7 +200,7 @@ mod test {
200200
let (port, chan) = rendezvous();
201201
do spawn_unlinked {
202202
port.duplex_stream.recv();
203-
fail!()
203+
fail2!()
204204
}
205205
chan.send(());
206206
}

branches/dist-snap/src/libextra/crypto/cryptoutil.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,23 @@ impl ToBits for u64 {
109109
}
110110
}
111111

112-
/// Adds the specified number of bytes to the bit count. fail!() if this would cause numeric
112+
/// Adds the specified number of bytes to the bit count. fail2!() if this would cause numeric
113113
/// overflow.
114114
pub fn add_bytes_to_bits<T: Int + CheckedAdd + ToBits>(bits: T, bytes: T) -> T {
115115
let (new_high_bits, new_low_bits) = bytes.to_bits();
116116

117117
if new_high_bits > Zero::zero() {
118-
fail!("Numeric overflow occured.")
118+
fail2!("Numeric overflow occured.")
119119
}
120120

121121
match bits.checked_add(&new_low_bits) {
122122
Some(x) => return x,
123-
None => fail!("Numeric overflow occured.")
123+
None => fail2!("Numeric overflow occured.")
124124
}
125125
}
126126

127127
/// Adds the specified number of bytes to the bit count, which is a tuple where the first element is
128-
/// the high order value. fail!() if this would cause numeric overflow.
128+
/// the high order value. fail2!() if this would cause numeric overflow.
129129
pub fn add_bytes_to_bits_tuple
130130
<T: Int + Unsigned + CheckedAdd + ToBits>
131131
(bits: (T, T), bytes: T) -> (T, T) {
@@ -144,15 +144,15 @@ pub fn add_bytes_to_bits_tuple
144144
} else {
145145
match hi.checked_add(&new_high_bits) {
146146
Some(y) => return (y, x),
147-
None => fail!("Numeric overflow occured.")
147+
None => fail2!("Numeric overflow occured.")
148148
}
149149
}
150150
},
151151
None => {
152152
let one: T = One::one();
153153
let z = match new_high_bits.checked_add(&one) {
154154
Some(w) => w,
155-
None => fail!("Numeric overflow occured.")
155+
None => fail2!("Numeric overflow occured.")
156156
};
157157
match hi.checked_add(&z) {
158158
// This re-executes the addition that was already performed earlier when overflow
@@ -163,7 +163,7 @@ pub fn add_bytes_to_bits_tuple
163163
// be Unsigned - overflow is not defined for Signed types. This function could be
164164
// implemented for signed types as well if that were needed.
165165
Some(y) => return (y, low + new_low_bits),
166-
None => fail!("Numeric overflow occured.")
166+
None => fail2!("Numeric overflow occured.")
167167
}
168168
}
169169
}

branches/dist-snap/src/libextra/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,11 @@ pub fn check_links<T>(list: &DList<T>) {
632632
loop {
633633
match (last_ptr, node_ptr.prev.resolve_immut()) {
634634
(None , None ) => {}
635-
(None , _ ) => fail!("prev link for list_head"),
635+
(None , _ ) => fail2!("prev link for list_head"),
636636
(Some(p), Some(pptr)) => {
637637
assert_eq!(p as *Node<T>, pptr as *Node<T>);
638638
}
639-
_ => fail!("prev link is none, not good"),
639+
_ => fail2!("prev link is none, not good"),
640640
}
641641
match node_ptr.next {
642642
Some(ref next) => {

0 commit comments

Comments
 (0)