Skip to content

Commit 9521551

Browse files
committed
librustc: Fix merge fallout.
1 parent 151b7ed commit 9521551

24 files changed

+43
-59
lines changed

src/libextra/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ mod tests {
19831983
}
19841984
fn check_err<T: Decodable<Decoder>>(to_parse: &'static str, expected_error: &str) {
19851985
use std::task;
1986-
let res = task::try(|| {
1986+
let res = do task::try {
19871987
// either fails in `decode` (which is what we want), or
19881988
// returns Some(error_message)/None if the string was
19891989
// invalid or valid JSON.
@@ -1994,7 +1994,7 @@ mod tests {
19941994
None
19951995
}
19961996
}
1997-
});
1997+
};
19981998
match res {
19991999
Ok(Some(parse_error)) => fail!("`{}` is not valid json: {}",
20002000
to_parse, parse_error),

src/libextra/sync.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,8 @@ impl<'self> Condvar<'self> {
230230
}).finally(|| {
231231
// Reacquire the condvar.
232232
match self.order {
233-
Just(lock) => do lock.access {
234-
self.sem.acquire();
235-
},
236-
Nothing => {
237-
self.sem.acquire();
238-
},
233+
Just(lock) => lock.access(|| self.sem.acquire()),
234+
Nothing => self.sem.acquire(),
239235
}
240236
})
241237
})

src/libextra/time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,9 +969,9 @@ mod tests {
969969
// Windows does not understand "America/Los_Angeles".
970970
// PST+08 may look wrong, but not! "PST" indicates
971971
// the name of timezone. "+08" means UTC = local + 08.
972-
do "TZ=PST+08".with_c_str |env| {
972+
"TZ=PST+08".with_c_str(|env| {
973973
_putenv(env);
974-
}
974+
})
975975
}
976976
tzset();
977977
}

src/librustc/middle/lint.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,17 +1204,17 @@ impl<'self> Visitor<()> for Context<'self> {
12041204
}
12051205

12061206
fn visit_foreign_item(&mut self, it: @ast::foreign_item, _: ()) {
1207-
do self.with_lint_attrs(it.attrs) |cx| {
1207+
self.with_lint_attrs(it.attrs, |cx| {
12081208
check_attrs_usage(cx, it.attrs);
12091209
visit::walk_foreign_item(cx, it, ());
1210-
}
1210+
})
12111211
}
12121212

12131213
fn visit_view_item(&mut self, i: &ast::view_item, _: ()) {
1214-
do self.with_lint_attrs(i.attrs) |cx| {
1214+
self.with_lint_attrs(i.attrs, |cx| {
12151215
check_attrs_usage(cx, i.attrs);
12161216
visit::walk_view_item(cx, i, ());
1217-
}
1217+
})
12181218
}
12191219

12201220
fn visit_pat(&mut self, p: &ast::Pat, _: ()) {

src/librustc/middle/privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> {
232232
_ => true,
233233
};
234234
let tr = ty::impl_trait_ref(self.tcx, local_def(item.id));
235-
let public_trait = do tr.map_default(false) |tr| {
235+
let public_trait = tr.map_default(false, |tr| {
236236
!is_local(tr.def_id) ||
237237
self.exported_items.contains(&tr.def_id.node)
238-
};
238+
});
239239

240240
if public_ty || public_trait {
241241
for method in methods.iter() {

src/librustpkg/testsuite/pass/src/c-dependencies/pkg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn main() {
5050
prep.declare_input("file",
5151
foo_c_name.as_str().unwrap().to_owned(),
5252
digest_file_with_date(&foo_c_name));
53-
let out_path = prep.exec(|exec| {
53+
let out_path = do prep.exec |exec| {
5454
let out_path = api::build_library_in_workspace(exec,
5555
&mut sub_cx.clone(),
5656
"cdep",
@@ -60,7 +60,7 @@ pub fn main() {
6060
"foo");
6161
let out_p = Path::new(out_path);
6262
out_p.as_str().unwrap().to_owned()
63-
});
63+
};
6464
out_path
6565
});
6666
let out_lib_path = Path::new(out_lib_path);

src/librustuv/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ impl TcpWatcher {
186186
0 => {
187187
req.defuse(); // uv callback now owns this request
188188
let mut cx = Ctx { status: 0, task: None };
189-
do wait_until_woken_after(&mut cx.task) {
189+
wait_until_woken_after(&mut cx.task, || {
190190
req.set_data(&cx);
191-
}
191+
});
192192
match cx.status {
193193
0 => Ok(()),
194194
n => Err(UvError(n)),

src/libstd/rc.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,28 +168,6 @@ impl<T> Drop for Rc<T> {
168168
}
169169
}
170170

171-
impl<T> Clone for RcMut<T> {
172-
/// Return a shallow copy of the reference counted pointer.
173-
#[inline]
174-
fn clone(&self) -> RcMut<T> {
175-
unsafe {
176-
(*self.ptr).count += 1;
177-
RcMut{ptr: self.ptr}
178-
}
179-
}
180-
}
181-
182-
impl<T: DeepClone> DeepClone for RcMut<T> {
183-
/// Return a deep copy of the reference counted pointer.
184-
#[inline]
185-
fn deep_clone(&self) -> RcMut<T> {
186-
self.with_borrow(|x| {
187-
// FIXME: #6497: should avoid freeze (slow)
188-
unsafe { RcMut::new_unchecked(x.deep_clone()) }
189-
})
190-
}
191-
}
192-
193171
#[cfg(test)]
194172
mod test_rc {
195173
use super::*;

src/libstd/rt/args.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ mod imp {
150150
assert!(take() == Some(expected.clone()));
151151
assert!(take() == None);
152152

153-
do (|| {
154-
}).finally {
153+
(|| {
154+
}).finally(|| {
155155
// Restore the actual global state.
156156
match saved_value {
157157
Some(ref args) => put(args.clone()),
158158
None => ()
159159
}
160-
}
160+
})
161161
}
162162
}
163163
}

src/libstd/rt/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,11 +990,11 @@ mod test {
990990
#[test]
991991
fn recv_a_lot() {
992992
// Regression test that we don't run out of stack in scheduler context
993-
run_in_newsched_task(|| {
993+
do run_in_newsched_task {
994994
let (port, chan) = stream();
995995
10000.times(|| { chan.send(()) });
996996
10000.times(|| { port.recv() });
997-
})
997+
}
998998
}
999999

10001000
#[test]

0 commit comments

Comments
 (0)