Skip to content

Commit

Permalink
libstd: cleanup warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aatch authored and James Miller committed Jun 20, 2013
1 parent 3bc4d1a commit 0702e53
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/libstd/comm.rs
Expand Up @@ -20,7 +20,6 @@ use either::{Either, Left, Right};
use kinds::Owned;
use option::{Option, Some, None};
use uint;
use vec;
use vec::OwnedVector;
use util::replace;
use unstable::sync::{Exclusive, exclusive};
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/old_iter.rs
Expand Up @@ -16,7 +16,7 @@

#[allow(missing_doc)];

use cmp::{Eq, Ord};
use cmp::{Eq};
use kinds::Copy;
use option::{None, Option, Some};
use vec;
Expand Down
10 changes: 4 additions & 6 deletions src/libstd/os.rs
Expand Up @@ -959,12 +959,10 @@ pub fn 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;
}
Expand Down
1 change: 0 additions & 1 deletion src/libstd/pipes.rs
Expand Up @@ -86,7 +86,6 @@ bounded and unbounded protocols allows for less code duplication.

use container::Container;
use cast::{forget, transmute, transmute_copy, transmute_mut};
use cast;
use either::{Either, Left, Right};
use iterator::IteratorUtil;
use kinds::Owned;
Expand Down
1 change: 0 additions & 1 deletion src/libstd/task/spawn.rs
Expand Up @@ -79,7 +79,6 @@ use cast;
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;
Expand Down
1 change: 0 additions & 1 deletion src/libstd/unstable/dynamic_lib.rs
Expand Up @@ -15,7 +15,6 @@ Dynamic library facilities.
A simple wrapper over the platforms dynamic library facilities
*/
use ptr;
use cast;
use path;
use libc;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/unstable/global.rs
Expand Up @@ -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
Expand Down
16 changes: 2 additions & 14 deletions src/libstd/unstable/lang.rs
Expand Up @@ -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 {
Expand All @@ -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();
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/vec.rs
Expand Up @@ -19,7 +19,7 @@ use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
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;
Expand Down

0 comments on commit 0702e53

Please sign in to comment.