about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2017-05-27 20:13:32 +0200
committerRobin Kruppe <robin.kruppe@gmail.com>2017-05-27 21:08:13 +0200
commit493cd6b6e2dfc400c4026f1f2c9b89e97055107e (patch)
treea64721216e91b2668cd90f07d8c00b680addce2d
parent557967766be6139bd747ab2c3dc56ff0c9b8852a (diff)
downloadrust-493cd6b6e2dfc400c4026f1f2c9b89e97055107e.tar.gz
rust-493cd6b6e2dfc400c4026f1f2c9b89e97055107e.zip
Reduce API surface of rustc_trans
Mark various items and fields as private or pub(crate), and remove a function that turns out to be unused.
These are not used anywhere in-tree, but I guess it's a [breaking-change] for plugins.
-rw-r--r--src/librustc_trans/assert_module_sources.rs4
-rw-r--r--src/librustc_trans/back/symbol_names.rs10
-rw-r--r--src/librustc_trans/lib.rs25
3 files changed, 13 insertions, 26 deletions
diff --git a/src/librustc_trans/assert_module_sources.rs b/src/librustc_trans/assert_module_sources.rs
index 63cfe591ce3..b5ef4aac34c 100644
--- a/src/librustc_trans/assert_module_sources.rs
+++ b/src/librustc_trans/assert_module_sources.rs
@@ -40,8 +40,8 @@ const CFG: &'static str = "cfg";
 #[derive(Debug, PartialEq)]
 enum Disposition { Reused, Translated }
 
-pub fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                       modules: &[ModuleTranslation]) {
+pub(crate) fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
+                                              modules: &[ModuleTranslation]) {
     let _ignore = tcx.dep_graph.in_ignore();
 
     if tcx.sess.opts.incremental.is_none() {
diff --git a/src/librustc_trans/back/symbol_names.rs b/src/librustc_trans/back/symbol_names.rs
index 1aed2932948..8e14335ceac 100644
--- a/src/librustc_trans/back/symbol_names.rs
+++ b/src/librustc_trans/back/symbol_names.rs
@@ -348,16 +348,6 @@ impl ItemPathBuffer for SymbolPathBuffer {
     }
 }
 
-pub fn exported_name_from_type_and_prefix<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                                    t: Ty<'tcx>,
-                                                    prefix: &str)
-                                                    -> String {
-    let hash = get_symbol_hash(tcx, None, t, None);
-    let mut buffer = SymbolPathBuffer::new();
-    buffer.push(prefix);
-    buffer.finish(hash)
-}
-
 // Name sanitation. LLVM will happily accept identifiers with weird names, but
 // gas doesn't!
 // gas accepts the following characters in symbols: a-z, A-Z, 0-9, ., _, $
diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs
index 3ac0d88b90d..cb3bc7bd200 100644
--- a/src/librustc_trans/lib.rs
+++ b/src/librustc_trans/lib.rs
@@ -63,10 +63,9 @@ extern crate syntax_pos;
 extern crate rustc_errors as errors;
 extern crate serialize;
 
-pub use rustc::session;
-pub use rustc::middle;
-pub use rustc::lint;
-pub use rustc::util;
+use rustc::session;
+use rustc::middle;
+use rustc::util;
 
 pub use base::trans_crate;
 pub use back::symbol_names::provide;
@@ -75,20 +74,18 @@ pub use metadata::LlvmMetadataLoader;
 pub use llvm_util::{init, target_features, print_version, print_passes, print, enable_llvm_debug};
 
 pub mod back {
-    pub use rustc::hir::svh;
-
-    pub mod archive;
-    pub mod linker;
+    mod archive;
+    pub(crate) mod linker;
     pub mod link;
-    pub mod lto;
-    pub mod symbol_export;
-    pub mod symbol_names;
+    mod lto;
+    pub(crate) mod symbol_export;
+    pub(crate) mod symbol_names;
     pub mod write;
-    pub mod msvc;
-    pub mod rpath;
+    mod msvc;
+    mod rpath;
 }
 
-pub mod diagnostics;
+mod diagnostics;
 
 mod abi;
 mod adt;