about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2014-11-28 11:57:41 -0500
committerCorey Farwell <coreyf@rwell.org>2014-12-05 18:13:04 -0500
commit4ef16741e355754abd446acbd80e5afb784864c7 (patch)
treebfe4f64de5b3bcf88672424d0f66b5ad12fe7054 /src/liballoc
parent6f4c11be3b9706d1ba0e1b74b89de1478410a56f (diff)
downloadrust-4ef16741e355754abd446acbd80e5afb784864c7.tar.gz
rust-4ef16741e355754abd446acbd80e5afb784864c7.zip
Utilize fewer reexports
In regards to:

https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729

This commit:

* Changes the #deriving code so that it generates code that utilizes fewer
  reexports (in particur Option::* and Result::*), which is necessary to
  remove those reexports in the future
* Changes other areas of the codebase so that fewer reexports are utilized
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs6
-rw-r--r--src/liballoc/boxed.rs3
-rw-r--r--src/liballoc/heap.rs3
-rw-r--r--src/liballoc/rc.rs11
4 files changed, 15 insertions, 8 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 4f744b0b2de..ef05279e825 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -22,7 +22,8 @@ use core::kinds::{Sync, Send};
 use core::mem::{min_align_of, size_of, drop};
 use core::mem;
 use core::ops::{Drop, Deref};
-use core::option::{Some, None, Option};
+use core::option::Option;
+use core::option::Option::{Some, None};
 use core::ptr::RawPtr;
 use core::ptr;
 use heap::deallocate;
@@ -326,7 +327,8 @@ mod tests {
     use std::comm::channel;
     use std::mem::drop;
     use std::ops::Drop;
-    use std::option::{Option, Some, None};
+    use std::option::Option;
+    use std::option::Option::{Some, None};
     use std::str::Str;
     use std::sync::atomic;
     use std::task;
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 000dda59e3d..eb483498998 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -19,7 +19,8 @@ use core::kinds::Sized;
 use core::mem;
 use core::option::Option;
 use core::raw::TraitObject;
-use core::result::{Ok, Err, Result};
+use core::result::Result;
+use core::result::Result::{Ok, Err};
 
 /// A value that represents the global exchange heap. This is the default
 /// place that the `box` keyword allocates into when no place is supplied.
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 067c235c9ae..c6b6a784f06 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -177,7 +177,8 @@ mod imp {
 
 #[cfg(all(not(external_funcs), not(external_crate), jemalloc))]
 mod imp {
-    use core::option::{None, Option};
+    use core::option::Option;
+    use core::option::Option::None;
     use core::ptr::{null_mut, null};
     use core::num::Int;
     use libc::{c_char, c_int, c_void, size_t};
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index e626d63937b..53891583edb 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -149,10 +149,12 @@ use core::fmt;
 use core::kinds::marker;
 use core::mem::{transmute, min_align_of, size_of, forget};
 use core::ops::{Deref, Drop};
-use core::option::{Option, Some, None};
+use core::option::Option;
+use core::option::Option::{Some, None};
 use core::ptr;
 use core::ptr::RawPtr;
-use core::result::{Result, Ok, Err};
+use core::result::Result;
+use core::result::Result::{Ok, Err};
 
 use heap::deallocate;
 
@@ -739,8 +741,9 @@ impl<T> RcBoxPtr<T> for Weak<T> {
 mod tests {
     use super::{Rc, Weak, weak_count, strong_count};
     use std::cell::RefCell;
-    use std::option::{Option, Some, None};
-    use std::result::{Err, Ok};
+    use std::option::Option;
+    use std::option::Option::{Some, None};
+    use std::result::Result::{Err, Ok};
     use std::mem::drop;
     use std::clone::Clone;