libstd: cleanup warnings
This commit is contained in:
parent
3bc4d1a120
commit
0702e53576
9 changed files with 9 additions and 27 deletions
|
@ -20,7 +20,6 @@ use either::{Either, Left, Right};
|
||||||
use kinds::Owned;
|
use kinds::Owned;
|
||||||
use option::{Option, Some, None};
|
use option::{Option, Some, None};
|
||||||
use uint;
|
use uint;
|
||||||
use vec;
|
|
||||||
use vec::OwnedVector;
|
use vec::OwnedVector;
|
||||||
use util::replace;
|
use util::replace;
|
||||||
use unstable::sync::{Exclusive, exclusive};
|
use unstable::sync::{Exclusive, exclusive};
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#[allow(missing_doc)];
|
#[allow(missing_doc)];
|
||||||
|
|
||||||
use cmp::{Eq, Ord};
|
use cmp::{Eq};
|
||||||
use kinds::Copy;
|
use kinds::Copy;
|
||||||
use option::{None, Option, Some};
|
use option::{None, Option, Some};
|
||||||
use vec;
|
use vec;
|
||||||
|
|
|
@ -959,12 +959,10 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
|
||||||
fclose(ostream);
|
fclose(ostream);
|
||||||
|
|
||||||
// Give the new file the old file's permissions
|
// Give the new file the old file's permissions
|
||||||
unsafe {
|
if do str::as_c_str(to.to_str()) |to_buf| {
|
||||||
if do str::as_c_str(to.to_str()) |to_buf| {
|
libc::chmod(to_buf, from_mode as mode_t)
|
||||||
libc::chmod(to_buf, from_mode as mode_t)
|
} != 0 {
|
||||||
} != 0 {
|
return false; // should be a condition...
|
||||||
return false; // should be a condition...
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ bounded and unbounded protocols allows for less code duplication.
|
||||||
|
|
||||||
use container::Container;
|
use container::Container;
|
||||||
use cast::{forget, transmute, transmute_copy, transmute_mut};
|
use cast::{forget, transmute, transmute_copy, transmute_mut};
|
||||||
use cast;
|
|
||||||
use either::{Either, Left, Right};
|
use either::{Either, Left, Right};
|
||||||
use iterator::IteratorUtil;
|
use iterator::IteratorUtil;
|
||||||
use kinds::Owned;
|
use kinds::Owned;
|
||||||
|
|
|
@ -79,7 +79,6 @@ use cast;
|
||||||
use cell::Cell;
|
use cell::Cell;
|
||||||
use container::Map;
|
use container::Map;
|
||||||
use comm::{Chan, GenericChan};
|
use comm::{Chan, GenericChan};
|
||||||
use ptr;
|
|
||||||
use hashmap::HashSet;
|
use hashmap::HashSet;
|
||||||
use task::local_data_priv::{local_get, local_set, OldHandle};
|
use task::local_data_priv::{local_get, local_set, OldHandle};
|
||||||
use task::rt::rust_task;
|
use task::rt::rust_task;
|
||||||
|
|
|
@ -15,7 +15,6 @@ Dynamic library facilities.
|
||||||
A simple wrapper over the platforms dynamic library facilities
|
A simple wrapper over the platforms dynamic library facilities
|
||||||
|
|
||||||
*/
|
*/
|
||||||
use ptr;
|
|
||||||
use cast;
|
use cast;
|
||||||
use path;
|
use path;
|
||||||
use libc;
|
use libc;
|
||||||
|
|
|
@ -105,7 +105,7 @@ unsafe fn global_data_modify_<T:Owned>(
|
||||||
let dtor: ~fn() = match maybe_dtor {
|
let dtor: ~fn() = match maybe_dtor {
|
||||||
Some(dtor) => dtor,
|
Some(dtor) => dtor,
|
||||||
None => {
|
None => {
|
||||||
let dtor: ~fn() = || unsafe {
|
let dtor: ~fn() = || {
|
||||||
let _destroy_value: ~T = transmute(data);
|
let _destroy_value: ~T = transmute(data);
|
||||||
};
|
};
|
||||||
dtor
|
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,
|
pub fn start(main: *u8, argc: int, argv: **c_char,
|
||||||
crate_map: *u8) -> int {
|
crate_map: *u8) -> int {
|
||||||
use rt;
|
use rt;
|
||||||
use sys::Closure;
|
|
||||||
use ptr;
|
|
||||||
use cast;
|
|
||||||
use os;
|
use os;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -399,17 +396,8 @@ pub fn start(main: *u8, argc: int, argv: **c_char,
|
||||||
crate_map as *c_void) as int;
|
crate_map as *c_void) as int;
|
||||||
} else {
|
} else {
|
||||||
return do rt::start(argc, argv as **u8, crate_map) {
|
return do rt::start(argc, argv as **u8, crate_map) {
|
||||||
unsafe {
|
let main: extern "Rust" fn() = transmute(main);
|
||||||
// `main` is an `fn() -> ()` that doesn't take an environment
|
main();
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
|
||||||
use clone::Clone;
|
use clone::Clone;
|
||||||
use old_iter::BaseIter;
|
use old_iter::BaseIter;
|
||||||
use old_iter;
|
use old_iter;
|
||||||
use iterator::{Iterator, IteratorUtil};
|
use iterator::{Iterator};
|
||||||
use iter::FromIter;
|
use iter::FromIter;
|
||||||
use kinds::Copy;
|
use kinds::Copy;
|
||||||
use libc;
|
use libc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue