diff options
| author | bors <bors@rust-lang.org> | 2015-12-30 07:35:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-30 07:35:10 +0000 |
| commit | a06bb977d86dcfe786d4265f4807a11c39b51141 (patch) | |
| tree | 27a2b4e75bd918cbe2276a3e9a26eac34825e72f /src/libstd/io | |
| parent | 6e2a64b57a74f35bef215972adf1b803cff288bd (diff) | |
| parent | e27cbeff370897b8450caa204c08049651a10c13 (diff) | |
| download | rust-a06bb977d86dcfe786d4265f4807a11c39b51141.tar.gz rust-a06bb977d86dcfe786d4265f4807a11c39b51141.zip | |
Auto merge of #30458 - fhahn:fix-warnings-tests-stdlib, r=sanxiyn
This PR siliences some warnings when compiling stdlib with --test. Mostly remove some unused imports and added a few `#[allow(..)]`. I also marked some signal handling functions with `#[cfg(not(test))]`, because they are only called through `rt::lang_start`, which is also marked as `#[cfg(not(test))]`
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/error.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/util.rs | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 79eedbeda2c..16ce05ef2dc 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -791,7 +791,7 @@ impl<W: Read + Write> Read for InternalBufWriter<W> { mod tests { use prelude::v1::*; use io::prelude::*; - use io::{self, BufReader, BufWriter, Cursor, LineWriter, SeekFrom}; + use io::{self, BufReader, BufWriter, LineWriter, SeekFrom}; use test; /// A dummy reader intended at testing short-reads propagation. diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 1dd96f5ddfc..e3f17c839f1 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -377,7 +377,7 @@ mod test { struct TestError; impl fmt::Display for TestError { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { Ok(()) } } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 7be0f467ac9..2ad45e80dd1 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1983,7 +1983,7 @@ mod tests { b.iter(|| { let mut lr = repeat(1).take(10000000); let mut vec = Vec::with_capacity(1024); - super::read_to_end(&mut lr, &mut vec); + super::read_to_end(&mut lr, &mut vec) }); } } diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index 07a9548224a..e05a0d577ff 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -199,6 +199,7 @@ mod tests { } #[test] + #[allow(deprecated)] fn tee() { let mut buf = [0; 10]; { @@ -209,6 +210,7 @@ mod tests { } #[test] + #[allow(deprecated)] fn broadcast() { let mut buf1 = [0; 10]; let mut buf2 = [0; 10]; |
