提交 0702e535 编写于 作者: J James Miller 提交者: James Miller

libstd: cleanup warnings

上级 3bc4d1a1
......@@ -20,7 +20,6 @@
use kinds::Owned;
use option::{Option, Some, None};
use uint;
use vec;
use vec::OwnedVector;
use util::replace;
use unstable::sync::{Exclusive, exclusive};
......
......@@ -16,7 +16,7 @@
#[allow(missing_doc)];
use cmp::{Eq, Ord};
use cmp::{Eq};
use kinds::Copy;
use option::{None, Option, Some};
use vec;
......
......@@ -959,12 +959,10 @@ fn do_copy_file(from: &Path, to: &Path) -> bool {
fclose(ostream);
// Give the new file the old file's permissions
unsafe {
if do str::as_c_str(to.to_str()) |to_buf| {
libc::chmod(to_buf, from_mode as mode_t)
} != 0 {
return false; // should be a condition...
}
if do str::as_c_str(to.to_str()) |to_buf| {
libc::chmod(to_buf, from_mode as mode_t)
} != 0 {
return false; // should be a condition...
}
return ok;
}
......
......@@ -86,7 +86,6 @@
use container::Container;
use cast::{forget, transmute, transmute_copy, transmute_mut};
use cast;
use either::{Either, Left, Right};
use iterator::IteratorUtil;
use kinds::Owned;
......
......@@ -79,7 +79,6 @@
use cell::Cell;
use container::Map;
use comm::{Chan, GenericChan};
use ptr;
use hashmap::HashSet;
use task::local_data_priv::{local_get, local_set, OldHandle};
use task::rt::rust_task;
......
......@@ -15,7 +15,6 @@
A simple wrapper over the platforms dynamic library facilities
*/
use ptr;
use cast;
use path;
use libc;
......
......@@ -105,7 +105,7 @@ unsafe fn global_data_modify_<T:Owned>(
let dtor: ~fn() = match maybe_dtor {
Some(dtor) => dtor,
None => {
let dtor: ~fn() = || unsafe {
let dtor: ~fn() = || {
let _destroy_value: ~T = transmute(data);
};
dtor
......
......@@ -387,9 +387,6 @@ pub unsafe fn strdup_uniq(ptr: *c_uchar, len: uint) -> ~str {
pub fn start(main: *u8, argc: int, argv: **c_char,
crate_map: *u8) -> int {
use rt;
use sys::Closure;
use ptr;
use cast;
use os;
unsafe {
......@@ -399,17 +396,8 @@ pub fn start(main: *u8, argc: int, argv: **c_char,
crate_map as *c_void) as int;
} else {
return do rt::start(argc, argv as **u8, crate_map) {
unsafe {
// `main` is an `fn() -> ()` that doesn't take an environment
// XXX: Could also call this as an `extern "Rust" fn` once they work
let main = Closure {
code: main as *(),
env: ptr::null(),
};
let mainfn: &fn() = cast::transmute(main);
mainfn();
}
let main: extern "Rust" fn() = transmute(main);
main();
};
}
}
......
......@@ -19,7 +19,7 @@
use clone::Clone;
use old_iter::BaseIter;
use old_iter;
use iterator::{Iterator, IteratorUtil};
use iterator::{Iterator};
use iter::FromIter;
use kinds::Copy;
use libc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册