Skip to content

Commit 493cd6b

Browse files
author
Robin Kruppe
committed
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.
1 parent 5579677 commit 493cd6b

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

src/librustc_trans/assert_module_sources.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ const CFG: &'static str = "cfg";
4040
#[derive(Debug, PartialEq)]
4141
enum Disposition { Reused, Translated }
4242

43-
pub fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
44-
modules: &[ModuleTranslation]) {
43+
pub(crate) fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
44+
modules: &[ModuleTranslation]) {
4545
let _ignore = tcx.dep_graph.in_ignore();
4646

4747
if tcx.sess.opts.incremental.is_none() {

src/librustc_trans/back/symbol_names.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,6 @@ impl ItemPathBuffer for SymbolPathBuffer {
348348
}
349349
}
350350

351-
pub fn exported_name_from_type_and_prefix<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
352-
t: Ty<'tcx>,
353-
prefix: &str)
354-
-> String {
355-
let hash = get_symbol_hash(tcx, None, t, None);
356-
let mut buffer = SymbolPathBuffer::new();
357-
buffer.push(prefix);
358-
buffer.finish(hash)
359-
}
360-
361351
// Name sanitation. LLVM will happily accept identifiers with weird names, but
362352
// gas doesn't!
363353
// gas accepts the following characters in symbols: a-z, A-Z, 0-9, ., _, $

src/librustc_trans/lib.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ extern crate syntax_pos;
6363
extern crate rustc_errors as errors;
6464
extern crate serialize;
6565

66-
pub use rustc::session;
67-
pub use rustc::middle;
68-
pub use rustc::lint;
69-
pub use rustc::util;
66+
use rustc::session;
67+
use rustc::middle;
68+
use rustc::util;
7069

7170
pub use base::trans_crate;
7271
pub use back::symbol_names::provide;
@@ -75,20 +74,18 @@ pub use metadata::LlvmMetadataLoader;
7574
pub use llvm_util::{init, target_features, print_version, print_passes, print, enable_llvm_debug};
7675

7776
pub mod back {
78-
pub use rustc::hir::svh;
79-
80-
pub mod archive;
81-
pub mod linker;
77+
mod archive;
78+
pub(crate) mod linker;
8279
pub mod link;
83-
pub mod lto;
84-
pub mod symbol_export;
85-
pub mod symbol_names;
80+
mod lto;
81+
pub(crate) mod symbol_export;
82+
pub(crate) mod symbol_names;
8683
pub mod write;
87-
pub mod msvc;
88-
pub mod rpath;
84+
mod msvc;
85+
mod rpath;
8986
}
9087

91-
pub mod diagnostics;
88+
mod diagnostics;
9289

9390
mod abi;
9491
mod adt;

0 commit comments

Comments
 (0)