Skip to content

Commit 0702e53

Browse files
AatchJames Miller
authored and
James Miller
committed
libstd: cleanup warnings
1 parent 3bc4d1a commit 0702e53

File tree

9 files changed

+9
-27
lines changed

9 files changed

+9
-27
lines changed

src/libstd/comm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use either::{Either, Left, Right};
2020
use kinds::Owned;
2121
use option::{Option, Some, None};
2222
use uint;
23-
use vec;
2423
use vec::OwnedVector;
2524
use util::replace;
2625
use unstable::sync::{Exclusive, exclusive};

src/libstd/old_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#[allow(missing_doc)];
1818

19-
use cmp::{Eq, Ord};
19+
use cmp::{Eq};
2020
use kinds::Copy;
2121
use option::{None, Option, Some};
2222
use vec;

src/libstd/os.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -959,12 +959,10 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
959959
fclose(ostream);
960960

961961
// Give the new file the old file's permissions
962-
unsafe {
963-
if do str::as_c_str(to.to_str()) |to_buf| {
964-
libc::chmod(to_buf, from_mode as mode_t)
965-
} != 0 {
966-
return false; // should be a condition...
967-
}
962+
if do str::as_c_str(to.to_str()) |to_buf| {
963+
libc::chmod(to_buf, from_mode as mode_t)
964+
} != 0 {
965+
return false; // should be a condition...
968966
}
969967
return ok;
970968
}

src/libstd/pipes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ bounded and unbounded protocols allows for less code duplication.
8686

8787
use container::Container;
8888
use cast::{forget, transmute, transmute_copy, transmute_mut};
89-
use cast;
9089
use either::{Either, Left, Right};
9190
use iterator::IteratorUtil;
9291
use kinds::Owned;

src/libstd/task/spawn.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ use cast;
7979
use cell::Cell;
8080
use container::Map;
8181
use comm::{Chan, GenericChan};
82-
use ptr;
8382
use hashmap::HashSet;
8483
use task::local_data_priv::{local_get, local_set, OldHandle};
8584
use task::rt::rust_task;

src/libstd/unstable/dynamic_lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Dynamic library facilities.
1515
A simple wrapper over the platforms dynamic library facilities
1616
1717
*/
18-
use ptr;
1918
use cast;
2019
use path;
2120
use libc;

src/libstd/unstable/global.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ unsafe fn global_data_modify_<T:Owned>(
105105
let dtor: ~fn() = match maybe_dtor {
106106
Some(dtor) => dtor,
107107
None => {
108-
let dtor: ~fn() = || unsafe {
108+
let dtor: ~fn() = || {
109109
let _destroy_value: ~T = transmute(data);
110110
};
111111
dtor

src/libstd/unstable/lang.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,6 @@ pub unsafe fn strdup_uniq(ptr: *c_uchar, len: uint) -> ~str {
387387
pub fn start(main: *u8, argc: int, argv: **c_char,
388388
crate_map: *u8) -> int {
389389
use rt;
390-
use sys::Closure;
391-
use ptr;
392-
use cast;
393390
use os;
394391

395392
unsafe {
@@ -399,17 +396,8 @@ pub fn start(main: *u8, argc: int, argv: **c_char,
399396
crate_map as *c_void) as int;
400397
} else {
401398
return do rt::start(argc, argv as **u8, crate_map) {
402-
unsafe {
403-
// `main` is an `fn() -> ()` that doesn't take an environment
404-
// XXX: Could also call this as an `extern "Rust" fn` once they work
405-
let main = Closure {
406-
code: main as *(),
407-
env: ptr::null(),
408-
};
409-
let mainfn: &fn() = cast::transmute(main);
410-
411-
mainfn();
412-
}
399+
let main: extern "Rust" fn() = transmute(main);
400+
main();
413401
};
414402
}
415403
}

src/libstd/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
1919
use clone::Clone;
2020
use old_iter::BaseIter;
2121
use old_iter;
22-
use iterator::{Iterator, IteratorUtil};
22+
use iterator::{Iterator};
2323
use iter::FromIter;
2424
use kinds::Copy;
2525
use libc;

0 commit comments

Comments
 (0)