Skip to content

Commit

Permalink
librustc: Fix merge fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Aug 28, 2013
1 parent 2bd46e7 commit aac9d6e
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 48 deletions.
2 changes: 1 addition & 1 deletion doc/rust.md
Expand Up @@ -2230,7 +2230,7 @@ Some examples of call expressions:
# fn add(x: int, y: int) -> int { 0 }
let x: int = add(1, 2);
let pi = FromStr::from_str::<f32>("3.14");
let pi: Option<f32> = FromStr::from_str("3.14");
~~~~

### Lambda expressions
Expand Down
15 changes: 8 additions & 7 deletions src/libextra/num/bigint.rs
Expand Up @@ -1169,8 +1169,8 @@ mod biguint_tests {
#[test]
fn test_shl() {
fn check(s: &str, shift: uint, ans: &str) {
let bu = (FromStrRadix::from_str_radix::<BigUint>(s, 16).unwrap() << shift)
.to_str_radix(16);
let opt_biguint: Option<BigUint> = FromStrRadix::from_str_radix(s, 16);
let bu = (opt_biguint.unwrap() << shift).to_str_radix(16);
assert_eq!(bu.as_slice(), ans);
}
Expand Down Expand Up @@ -1207,8 +1207,9 @@ mod biguint_tests {
#[test]
fn test_shr() {
fn check(s: &str, shift: uint, ans: &str) {
let bu = (FromStrRadix::from_str_radix::<BigUint>(s, 16).unwrap() >> shift)
.to_str_radix(16);
let opt_biguint: Option<BigUint> =
FromStrRadix::from_str_radix(s, 16);
let bu = (opt_biguint.unwrap() >> shift).to_str_radix(16);
assert_eq!(bu.as_slice(), ans);
}

Expand Down Expand Up @@ -2015,16 +2016,16 @@ mod bench {
use extra::test::BenchHarness;

fn factorial(n: uint) -> BigUint {
let mut f = One::one::<BigUint>();
let mut f: BigUint = One::one();
for i in iterator::range_inclusive(1, n) {
f = f * BigUint::from_uint(i);
}
f
}

fn fib(n: uint) -> BigUint {
let mut f0 = Zero::zero::<BigUint>();
let mut f1 = One::one::<BigUint>();
let mut f0: BigUint = Zero::zero();
let mut f1: BigUint = One::one();
for _ in range(0, n) {
let f2 = f0 + f1;
f0 = util::replace(&mut f1, f2);
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/middle/borrowck/check_loans.rs
Expand Up @@ -23,7 +23,7 @@ use mc = middle::mem_categorization;
use middle::borrowck::*;
use middle::moves;
use middle::ty;
use syntax::ast::m_mutbl;
use syntax::ast::{m_imm, m_mutbl};
use syntax::ast;
use syntax::ast_util;
use syntax::codemap::span;
Expand Down Expand Up @@ -488,7 +488,6 @@ impl<'self> CheckLoanCtxt<'self> {
mc::cat_deref(_, _, mc::unsafe_ptr(*)) |
mc::cat_static_item(*) |
mc::cat_deref(_, _, mc::gc_ptr(_)) |
mc::cat_deref(_, _, mc::region_ptr(m_const, _)) |
mc::cat_deref(_, _, mc::region_ptr(m_imm, _)) => {
// Aliasability is independent of base cmt
match cmt.freely_aliasable() {
Expand Down
11 changes: 5 additions & 6 deletions src/librustc/middle/trans/expr.rs
Expand Up @@ -824,17 +824,16 @@ fn trans_def_datum_unadjusted(bcx: @mut Block,
{
let _icx = push_ctxt("trans_def_datum_unadjusted");

match def {
let fn_data = match def {
ast::def_fn(did, _) |
ast::def_static_method(did, ast::FromImpl(_), _) => {
callee::trans_fn_ref(bcx, did, ref_expr.id)
}
ast::def_static_method(impl_did, ast::FromTrait(trait_did), _) => {
let fn_data = meth::trans_static_method_callee(bcx,
impl_did,
trait_did,
ref_expr.id);
return fn_data_to_datum(bcx, ref_expr, impl_did, fn_data);
meth::trans_static_method_callee(bcx,
impl_did,
trait_did,
ref_expr.id)
}
_ => {
bcx.tcx().sess.span_bug(ref_expr.span, fmt!(
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/rt/io/file.rs
Expand Up @@ -24,7 +24,7 @@ pub fn open<P: PathLike>(path: &P,
access: FileAccess
) -> Option<FileStream> {
let open_result = unsafe {
let io = Local::unsafe_borrow::<IoFactoryObject>();
let io: *mut IoFactoryObject = Local::unsafe_borrow();
(*io).fs_open(path, mode, access)
};
match open_result {
Expand All @@ -43,7 +43,7 @@ pub fn open<P: PathLike>(path: &P,
/// by `path`.
pub fn unlink<P: PathLike>(path: &P) {
let unlink_result = unsafe {
let io = Local::unsafe_borrow::<IoFactoryObject>();
let io: *mut IoFactoryObject = Local::unsafe_borrow();
(*io).fs_unlink(path)
};
match unlink_result {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/local.rs
Expand Up @@ -107,7 +107,7 @@ impl Local for Scheduler {
}
unsafe fn try_unsafe_borrow() -> Option<*mut Scheduler> {
let task_opt: Option<*mut Task> = Local::try_unsafe_borrow();
match Local::try_unsafe_borrow::<Task>() {
match task_opt {
Some(task) => {
match (*task).sched {
Some(~ref mut sched) => {
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/rt/sched.rs
Expand Up @@ -175,7 +175,7 @@ impl Scheduler {
sched.run();

// Close the idle callback.
let mut sched = Local::take::<Scheduler>();
let mut sched: ~Scheduler = Local::take();
sched.idle_callback.get_mut_ref().close();
// Make one go through the loop to run the close callback.
sched.run();
Expand Down Expand Up @@ -581,7 +581,7 @@ impl Scheduler {
// run the cleanup job, as expected by the previously called
// swap_contexts function.
unsafe {
let task: *mut Task = Local::unsafe_borrow::<Task>();
let task: *mut Task = Local::unsafe_borrow();
(*task).sched.get_mut_ref().run_cleanup_job();

// Must happen after running the cleanup job (of course).
Expand Down
28 changes: 14 additions & 14 deletions src/libstd/rt/uv/uvio.rs
Expand Up @@ -92,7 +92,7 @@ trait HomingIO {
// go home
let old_home = Cell::new_empty();
let old_home_ptr = &old_home;
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
do scheduler.deschedule_running_task_and_then |_, task| {
// get the old home first
do task.wake().map_move |mut task| {
Expand All @@ -102,11 +102,11 @@ trait HomingIO {
}

// do IO
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
let a = io_sched(self, scheduler);

// unhome home
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
do scheduler.deschedule_running_task_and_then |scheduler, task| {
do task.wake().map_move |mut task| {
task.give_home(old_home.take());
Expand Down Expand Up @@ -442,7 +442,7 @@ impl IoFactory for UvIoFactory {
do stream.close {
let res = Err(uv_error_to_io_error(status.unwrap()));
unsafe { (*result_cell_ptr).put_back(res); }
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
}
}
Expand Down Expand Up @@ -539,7 +539,7 @@ impl IoFactory for UvIoFactory {
IoError>> = &result_cell;
let path_cell = Cell::new(path);
do task::unkillable { // FIXME(#8674)
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
do scheduler.deschedule_running_task_and_then |_, task| {
let task_cell = Cell::new(task);
let path = path_cell.take();
Expand All @@ -553,12 +553,12 @@ impl IoFactory for UvIoFactory {
loop_, fd, true, home) as ~RtioFileStream;
let res = Ok(fs);
unsafe { (*result_cell_ptr).put_back(res); }
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
} else {
let res = Err(uv_error_to_io_error(err.unwrap()));
unsafe { (*result_cell_ptr).put_back(res); }
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
}
};
Expand All @@ -573,7 +573,7 @@ impl IoFactory for UvIoFactory {
let result_cell_ptr: *Cell<Result<(), IoError>> = &result_cell;
let path_cell = Cell::new(path);
do task::unkillable { // FIXME(#8674)
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
do scheduler.deschedule_running_task_and_then |_, task| {
let task_cell = Cell::new(task);
let path = path_cell.take();
Expand All @@ -583,7 +583,7 @@ impl IoFactory for UvIoFactory {
Some(err) => Err(uv_error_to_io_error(err))
};
unsafe { (*result_cell_ptr).put_back(res); }
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
};
};
Expand Down Expand Up @@ -1154,7 +1154,7 @@ impl UvFileStream {
Some(err) => Err(uv_error_to_io_error(err))
};
unsafe { (*result_cell_ptr).put_back(res); }
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
};
};
Expand All @@ -1175,7 +1175,7 @@ impl UvFileStream {
Some(err) => Err(uv_error_to_io_error(err))
};
unsafe { (*result_cell_ptr).put_back(res); }
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
};
};
Expand Down Expand Up @@ -1208,7 +1208,7 @@ impl Drop for UvFileStream {
do scheduler.deschedule_running_task_and_then |_, task| {
let task_cell = Cell::new(task);
do self_.fd.close(&self.loop_) |_,_| {
let scheduler = Local::take::<Scheduler>();
let scheduler: ~Scheduler = Local::take();
scheduler.resume_blocked_task_immediately(task_cell.take());
};
};
Expand Down Expand Up @@ -1776,7 +1776,7 @@ fn file_test_uvio_full_simple_impl() {
use path::Path;
use rt::io::{Open, Create, ReadWrite, Read};
unsafe {
let io = Local::unsafe_borrow::<IoFactoryObject>();
let io: *mut IoFactoryObject = Local::unsafe_borrow();
let write_val = "hello uvio!";
let path = "./tmp/file_test_uvio_full.txt";
{
Expand Down Expand Up @@ -1810,7 +1810,7 @@ fn uvio_naive_print(input: &str) {
use str::StrSlice;
unsafe {
use libc::{STDOUT_FILENO};
let io = Local::unsafe_borrow::<IoFactoryObject>();
let io: *mut IoFactoryObject = Local::unsafe_borrow();
{
let mut fd = (*io).fs_from_raw_fd(STDOUT_FILENO, false);
let write_buf = input.as_bytes();
Expand Down
18 changes: 9 additions & 9 deletions src/test/bench/core-map.rs
Expand Up @@ -121,54 +121,54 @@ fn main() {
io::println("\nTreeMap:");

{
let mut map = TreeMap::new::<uint, uint>();
let mut map: TreeMap<uint,uint> = TreeMap::new();
ascending(&mut map, n_keys);
}

{
let mut map = TreeMap::new::<uint, uint>();
let mut map: TreeMap<uint,uint> = TreeMap::new();
descending(&mut map, n_keys);
}

{
io::println(" Random integers:");
let mut map = TreeMap::new::<uint, uint>();
let mut map: TreeMap<uint,uint> = TreeMap::new();
vector(&mut map, n_keys, rand);
}

io::println("\nHashMap:");

{
let mut map = HashMap::new::<uint, uint>();
let mut map: HashMap<uint,uint> = HashMap::new();
ascending(&mut map, n_keys);
}

{
let mut map = HashMap::new::<uint, uint>();
let mut map: HashMap<uint,uint> = HashMap::new();
descending(&mut map, n_keys);
}

{
io::println(" Random integers:");
let mut map = HashMap::new::<uint, uint>();
let mut map: HashMap<uint,uint> = HashMap::new();
vector(&mut map, n_keys, rand);
}

io::println("\nTrieMap:");

{
let mut map = TrieMap::new::<uint>();
let mut map: TrieMap<uint> = TrieMap::new();
ascending(&mut map, n_keys);
}

{
let mut map = TrieMap::new::<uint>();
let mut map: TrieMap<uint> = TrieMap::new();
descending(&mut map, n_keys);
}

{
io::println(" Random integers:");
let mut map = TrieMap::new::<uint>();
let mut map: TrieMap<uint> = TrieMap::new();
vector(&mut map, n_keys, rand);
}
}
20 changes: 16 additions & 4 deletions src/test/bench/core-set.rs
Expand Up @@ -169,16 +169,28 @@ fn main() {
{
let mut rng = rand::IsaacRng::new_seeded(seed);
let mut results = empty_results();
results.bench_int(&mut rng, num_keys, max, || HashSet::new::<uint>());
results.bench_str(&mut rng, num_keys, || HashSet::new::<~str>());
results.bench_int(&mut rng, num_keys, max, || {
let s: HashSet<uint> = HashSet::new();
s
});
results.bench_str(&mut rng, num_keys, || {
let s: HashSet<~str> = HashSet::new();
s
});
write_results("std::hashmap::HashSet", &results);
}

{
let mut rng = rand::IsaacRng::new_seeded(seed);
let mut results = empty_results();
results.bench_int(&mut rng, num_keys, max, || TreeSet::new::<uint>());
results.bench_str(&mut rng, num_keys, || TreeSet::new::<~str>());
results.bench_int(&mut rng, num_keys, max, || {
let s: TreeSet<uint> = TreeSet::new();
s
});
results.bench_str(&mut rng, num_keys, || {
let s: TreeSet<~str> = TreeSet::new();
s
});
write_results("extra::treemap::TreeSet", &results);
}

Expand Down
@@ -1,3 +1,5 @@
// xfail-pretty

// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/trait-bounds-in-arc.rs
@@ -1,3 +1,5 @@
// xfail-pretty

// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
Expand Down

5 comments on commit aac9d6e

@bors
Copy link
Contributor

@bors bors commented on aac9d6e Aug 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at pcwalton@aac9d6e

@bors
Copy link
Contributor

@bors bors commented on aac9d6e Aug 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging pcwalton/rust/compile-speed = aac9d6e into auto

@bors
Copy link
Contributor

@bors bors commented on aac9d6e Aug 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pcwalton/rust/compile-speed = aac9d6e merged ok, testing candidate = 578e680

@bors
Copy link
Contributor

@bors bors commented on aac9d6e Aug 28, 2013

@bors
Copy link
Contributor

@bors bors commented on aac9d6e Aug 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 578e680

Please sign in to comment.