From dbde7419cc120d97e520063682751dfc3a901fb5 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 28 Nov 2014 16:02:33 +1300 Subject: [PATCH] Fix fallout --- src/libgraphviz/maybe_owned_vec.rs | 1 - src/librustc_borrowck/borrowck/check_loans.rs | 2 -- .../borrowck/gather_loans/gather_moves.rs | 1 - src/librustc_borrowck/borrowck/gather_loans/mod.rs | 1 - .../borrowck/gather_loans/restrictions.rs | 2 -- src/librustc_driver/driver.rs | 7 ++++--- src/librustc_resolve/lib.rs | 4 ++-- src/libstd/ascii.rs | 2 +- src/libstd/comm/mod.rs | 11 ++++------- src/libstd/io/mem.rs | 2 +- src/libstd/io/net/pipe.rs | 2 +- src/libstd/io/net/udp.rs | 4 ++-- src/libstd/io/process.rs | 2 +- src/libstd/path/posix.rs | 2 +- src/libstd/path/windows.rs | 2 +- 15 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/libgraphviz/maybe_owned_vec.rs b/src/libgraphviz/maybe_owned_vec.rs index 88483b6c935..ddda2b38c22 100644 --- a/src/libgraphviz/maybe_owned_vec.rs +++ b/src/libgraphviz/maybe_owned_vec.rs @@ -14,7 +14,6 @@ pub use self::MaybeOwnedVector::*; use std::default::Default; use std::fmt; -use std::iter::FromIterator; use std::path::BytesContainer; use std::slice; diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index 568bb023b68..046b9547cbb 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -19,8 +19,6 @@ use self::UseError::*; use borrowck::*; -use borrowck::LoanPathElem::*; -use borrowck::LoanPathKind::*; use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::region; diff --git a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs index 01cbab6dbf4..85cc691fb9d 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs @@ -11,7 +11,6 @@ //! Computes moves. use borrowck::*; -use borrowck::LoanPathKind::*; use borrowck::gather_loans::move_error::MoveSpanAndPath; use borrowck::gather_loans::move_error::{MoveError, MoveErrorCollector}; use borrowck::move_data::*; diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index d7f50ccc6ba..c0e892cdd27 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -17,7 +17,6 @@ // sure that all of these loans are honored. use borrowck::*; -use borrowck::LoanPathKind::*; use borrowck::move_data::MoveData; use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; diff --git a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs index c783489dab7..fc15c0eb4ec 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs @@ -13,8 +13,6 @@ pub use self::RestrictionResult::*; use borrowck::*; -use borrowck::LoanPathElem::*; -use borrowck::LoanPathKind::*; use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::ty; diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index c727bea4c2c..f132ede06a4 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -342,9 +342,10 @@ pub fn phase_3_run_analysis_passes<'tcx>(sess: Session, let lang_items = time(time_passes, "language item collection", (), |_| middle::lang_items::collect_language_items(krate, &sess)); - let make_glob_map = match save_analysis(&sess) { - true => middle::resolve::MakeGlobMap::Yes, - false => middle::resolve::MakeGlobMap::No, + let make_glob_map = if save_analysis(&sess) { + middle::resolve::MakeGlobMap::Yes + } else { + middle::resolve::MakeGlobMap::No }; def_map, freevars, diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 815a8400a37..03e992ef7a7 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -346,7 +346,7 @@ impl Rib { } /// Whether an import can be shadowed by another import. -#[deriving(Show,PartialEq,Clone)] +#[deriving(Show,PartialEq,Clone,Copy)] enum Shadowable { Always, /// Means that the recorded import obeys the glob shadowing rules, i.e., can @@ -6113,7 +6113,7 @@ pub struct CrateMap { pub glob_map: Option } -#[deriving(PartialEq)] +#[deriving(PartialEq,Copy)] pub enum MakeGlobMap { Yes, No diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 6c213555ce4..072ac89c7c8 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -630,8 +630,8 @@ static ASCII_UPPER_MAP: [u8, ..256] = [ #[cfg(test)] mod tests { - use prelude::*; use super::*; + use prelude::*; use char::from_u32; macro_rules! v2ascii { diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs index 7352cdfbfe7..d3bfaab83da 100644 --- a/src/libstd/comm/mod.rs +++ b/src/libstd/comm/mod.rs @@ -333,12 +333,10 @@ macro_rules! test { mod $name { #![allow(unused_imports)] - use prelude::*; - use rt; - - use comm::*; use super::*; + use comm::*; use thread::Thread; + use prelude::*; $(#[$a])* #[test] fn f() { $b } } @@ -1022,10 +1020,9 @@ impl Drop for Receiver { #[cfg(test)] mod test { - use prelude::*; - - use os; use super::*; + use prelude::*; + use os; pub fn stress_factor() -> uint { match os::getenv("RUST_TEST_STRESS") { diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs index 431e11cf9ca..01151059530 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -399,9 +399,9 @@ impl<'a> Buffer for BufReader<'a> { #[cfg(test)] mod test { extern crate "test" as test_crate; - use prelude::*; use super::*; use io::*; + use prelude::*; use io; use self::test_crate::Bencher; diff --git a/src/libstd/io/net/pipe.rs b/src/libstd/io/net/pipe.rs index 01eb33b44f9..4afc72cde71 100644 --- a/src/libstd/io/net/pipe.rs +++ b/src/libstd/io/net/pipe.rs @@ -266,10 +266,10 @@ impl sys_common::AsInner for UnixAcceptor { #[cfg(test)] #[allow(experimental)] mod tests { - use prelude::*; use super::*; use io::*; use io::test::*; + use prelude::*; use io::fs::PathExtensions; use time::Duration; diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index f462143faf4..a36703172c3 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -249,10 +249,10 @@ impl Writer for UdpStream { #[allow(experimental)] mod test { use super::*; - use prelude::*; - use io::*; use io::net::ip::*; + use io::*; use io::test::*; + use prelude::*; // FIXME #11530 this fails on android because tests are run as root #[cfg_attr(any(windows, target_os = "android"), ignore)] diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 4a0a3936424..93aa627ffba 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -744,9 +744,9 @@ mod tests { #![allow(unused_imports)] use super::*; - use prelude::*; use io::timer::*; use io::*; + use prelude::*; use io::fs::PathExtensions; use time::Duration; use str; diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index f0a00b421c3..c72e41d61c0 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -447,8 +447,8 @@ static dot_dot_static: &'static [u8] = b".."; #[cfg(test)] mod tests { - use prelude::*; use super::*; + use prelude::*; use str; macro_rules! t { diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 7d10188c437..278908b8068 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -1121,7 +1121,7 @@ fn prefix_len(p: Option) -> uint { #[cfg(test)] mod tests { - use prelude::*; + use mem; use super::*; use super::PathPrefix::*; use super::parse_prefix;