Skip to content

Commit dcc5c7c

Browse files
committed
Remove pub(crate) in crate roots
1 parent 68d442d commit dcc5c7c

File tree

14 files changed

+77
-77
lines changed

14 files changed

+77
-77
lines changed

src/librustc_borrowck/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub use borrowck::build_borrowck_dataflow_data_for_fn;
4242

4343
// NB: This module needs to be declared first so diagnostics are
4444
// registered before they are used.
45-
pub(crate) mod diagnostics;
45+
mod diagnostics;
4646

4747
mod borrowck;
4848

src/librustc_const_eval/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extern crate syntax_pos;
4141

4242
// NB: This module needs to be declared first so diagnostics are
4343
// registered before they are used.
44-
pub(crate) mod diagnostics;
44+
mod diagnostics;
4545

4646
mod eval;
4747
mod _match;

src/librustc_driver/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ use syntax::parse::{self, PResult};
102102
use syntax_pos::{DUMMY_SP, MultiSpan};
103103

104104
#[cfg(test)]
105-
pub(crate) mod test;
105+
mod test;
106106

107107
pub mod driver;
108-
pub(crate) mod pretty;
108+
mod pretty;
109109
pub mod target_features;
110110
mod derive_registrar;
111111

@@ -273,7 +273,7 @@ pub enum Compilation {
273273
}
274274

275275
impl Compilation {
276-
pub(crate) fn and_then<F: FnOnce() -> Compilation>(self, next: F) -> Compilation {
276+
fn and_then<F: FnOnce() -> Compilation>(self, next: F) -> Compilation {
277277
match self {
278278
Compilation::Stop => Compilation::Stop,
279279
Compilation::Continue => next(),
@@ -617,7 +617,7 @@ fn save_analysis_format(sess: &Session) -> save::Format {
617617
}
618618

619619
impl RustcDefaultCalls {
620-
pub(crate) fn list_metadata(sess: &Session, matches: &getopts::Matches, input: &Input) -> Compilation {
620+
fn list_metadata(sess: &Session, matches: &getopts::Matches, input: &Input) -> Compilation {
621621
let r = matches.opt_strs("Z");
622622
if r.contains(&("ls".to_string())) {
623623
match input {
@@ -759,17 +759,17 @@ impl RustcDefaultCalls {
759759
}
760760

761761
/// Returns a version string such as "0.12.0-dev".
762-
pub(crate) fn release_str() -> Option<&'static str> {
762+
fn release_str() -> Option<&'static str> {
763763
option_env!("CFG_RELEASE")
764764
}
765765

766766
/// Returns the full SHA1 hash of HEAD of the Git repo from which rustc was built.
767-
pub(crate) fn commit_hash_str() -> Option<&'static str> {
767+
fn commit_hash_str() -> Option<&'static str> {
768768
option_env!("CFG_VER_HASH")
769769
}
770770

771771
/// Returns the "commit date" of HEAD of the Git repo from which rustc was built as a static string.
772-
pub(crate) fn commit_date_str() -> Option<&'static str> {
772+
fn commit_date_str() -> Option<&'static str> {
773773
option_env!("CFG_VER_DATE")
774774
}
775775

@@ -1016,7 +1016,7 @@ fn print_flag_list<T>(cmdline_opt: &str,
10161016
///
10171017
/// So with all that in mind, the comments below have some more detail about the
10181018
/// contortions done here to get things to work out correctly.
1019-
pub(crate) fn handle_options(args: &[String]) -> Option<getopts::Matches> {
1019+
fn handle_options(args: &[String]) -> Option<getopts::Matches> {
10201020
// Throw away the first argument, the name of the binary
10211021
let args = &args[1..];
10221022

@@ -1200,7 +1200,7 @@ fn exit_on_err() -> ! {
12001200
panic!();
12011201
}
12021202

1203-
pub(crate) fn diagnostics_registry() -> errors::registry::Registry {
1203+
fn diagnostics_registry() -> errors::registry::Registry {
12041204
use errors::registry::Registry;
12051205

12061206
let mut all_errors = Vec::new();

src/librustc_errors/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ use std::cell::{RefCell, Cell};
3838
use std::{error, fmt};
3939
use std::rc::Rc;
4040

41-
pub(crate) mod diagnostic;
42-
pub(crate) mod diagnostic_builder;
41+
mod diagnostic;
42+
mod diagnostic_builder;
4343
pub mod emitter;
4444
mod snippet;
4545
pub mod registry;
@@ -110,7 +110,7 @@ impl CodeSuggestion {
110110
}
111111

112112
/// Returns the number of substitutions
113-
pub(crate) fn substitution_spans<'a>(&'a self) -> impl Iterator<Item = Span> + 'a {
113+
fn substitution_spans<'a>(&'a self) -> impl Iterator<Item = Span> + 'a {
114114
self.substitution_parts.iter().map(|sub| sub.span)
115115
}
116116

@@ -492,7 +492,7 @@ impl Handler {
492492
self.bug(&format!("unimplemented {}", msg));
493493
}
494494

495-
pub(crate) fn bump_err_count(&self) {
495+
fn bump_err_count(&self) {
496496
self.err_count.set(self.err_count.get() + 1);
497497
}
498498

@@ -571,7 +571,7 @@ impl fmt::Display for Level {
571571
}
572572

573573
impl Level {
574-
pub(crate) fn color(self) -> term::color::Color {
574+
fn color(self) -> term::color::Color {
575575
match self {
576576
Bug | Fatal | PhaseFatal | Error => term::color::BRIGHT_RED,
577577
Warning => {

src/librustc_lint/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ extern crate rustc_back;
4646
extern crate rustc_const_eval;
4747
extern crate syntax_pos;
4848

49-
pub(crate) use rustc::lint;
50-
pub(crate) use rustc::middle;
51-
pub(crate) use rustc::session;
52-
pub(crate) use rustc::util;
49+
use rustc::lint;
50+
use rustc::middle;
51+
use rustc::session;
52+
use rustc::util;
5353

5454
use session::Session;
5555
use lint::LintId;

src/librustc_llvm/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use libc::{c_uint, c_char, size_t};
5151

5252
pub mod archive_ro;
5353
pub mod diagnostic;
54-
pub(crate) mod ffi;
54+
mod ffi;
5555

5656
pub use ffi::*;
5757

@@ -120,7 +120,7 @@ impl FromStr for ArchiveKind {
120120

121121
#[allow(missing_copy_implementations)]
122122
pub enum RustString_opaque {}
123-
pub(crate) type RustStringRef = *mut RustString_opaque;
123+
type RustStringRef = *mut RustString_opaque;
124124
type RustStringRepr = *mut RefCell<Vec<u8>>;
125125

126126
/// Appending to a Rust string -- used by RawRustStringOstream.
@@ -199,8 +199,8 @@ impl Attribute {
199199

200200
// Memory-managed interface to target data.
201201

202-
pub(crate) struct TargetData {
203-
pub(crate) lltd: TargetDataRef,
202+
struct TargetData {
203+
lltd: TargetDataRef,
204204
}
205205

206206
impl Drop for TargetData {
@@ -211,7 +211,7 @@ impl Drop for TargetData {
211211
}
212212
}
213213

214-
pub(crate) fn mk_target_data(string_rep: &str) -> TargetData {
214+
fn mk_target_data(string_rep: &str) -> TargetData {
215215
let string_rep = CString::new(string_rep).unwrap();
216216
TargetData { lltd: unsafe { LLVMCreateTargetData(string_rep.as_ptr()) } }
217217
}
@@ -272,7 +272,7 @@ pub fn get_param(llfn: ValueRef, index: c_uint) -> ValueRef {
272272
}
273273
}
274274

275-
pub(crate) fn get_params(llfn: ValueRef) -> Vec<ValueRef> {
275+
fn get_params(llfn: ValueRef) -> Vec<ValueRef> {
276276
unsafe {
277277
let num_params = LLVMCountParams(llfn);
278278
let mut params = Vec::with_capacity(num_params as usize);

src/librustc_mir/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ extern crate rustc_const_math;
4444
extern crate rustc_const_eval;
4545
extern crate core; // for NonZero
4646

47-
pub(crate) mod diagnostics;
47+
mod diagnostics;
4848

4949
mod build;
50-
pub(crate) mod dataflow;
50+
mod dataflow;
5151
mod hair;
5252
mod shim;
5353
pub mod transform;

src/librustc_passes/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ extern crate syntax;
3636
extern crate syntax_pos;
3737
extern crate rustc_errors as errors;
3838

39-
pub(crate) mod diagnostics;
39+
mod diagnostics;
4040

4141
pub mod ast_validation;
4242
pub mod consts;
4343
pub mod hir_stats;
4444
pub mod loops;
45-
pub(crate) mod mir_stats;
45+
mod mir_stats;
4646
pub mod no_asm;
4747
pub mod static_recursion;

src/librustc_plugin/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//! use syntax::tokenstream::TokenTree;
3737
//!
3838
//! #[plugin_registrar]
39-
//! pub(crate) fn plugin_registrar(reg: &mut Registry) {
39+
//! fn plugin_registrar(reg: &mut Registry) {
4040
//! reg.register_macro("mymacro", expand_mymacro);
4141
//! }
4242
//!
@@ -80,7 +80,7 @@ extern crate rustc_errors as errors;
8080

8181
pub use self::registry::Registry;
8282

83-
pub(crate) mod diagnostics;
83+
mod diagnostics;
8484
pub mod registry;
8585
pub mod load;
8686
pub mod build;

src/librustc_privacy/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use std::cmp;
4141
use std::mem::replace;
4242
use std::rc::Rc;
4343

44-
pub(crate) mod diagnostics;
44+
mod diagnostics;
4545

4646
////////////////////////////////////////////////////////////////////////////////
4747
/// Visitor used to determine if pub(restricted) is used anywhere in the crate.

src/librustc_resolve/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,14 @@ impl<'a> PathSource<'a> {
548548
}
549549

550550
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
551-
pub(crate) enum Namespace {
551+
enum Namespace {
552552
TypeNS,
553553
ValueNS,
554554
MacroNS,
555555
}
556556

557557
#[derive(Clone, Default, Debug)]
558-
pub(crate) struct PerNS<T> {
558+
struct PerNS<T> {
559559
value_ns: T,
560560
type_ns: T,
561561
macro_ns: Option<T>,
@@ -827,7 +827,7 @@ enum ModuleKind {
827827
}
828828

829829
/// One node in the tree of modules.
830-
pub(crate) struct ModuleData<'a> {
830+
struct ModuleData<'a> {
831831
parent: Option<Module<'a>>,
832832
kind: ModuleKind,
833833

@@ -860,7 +860,7 @@ pub(crate) struct ModuleData<'a> {
860860
expansion: Mark,
861861
}
862862

863-
pub(crate) type Module<'a> = &'a ModuleData<'a>;
863+
type Module<'a> = &'a ModuleData<'a>;
864864

865865
impl<'a> ModuleData<'a> {
866866
fn new(parent: Option<Module<'a>>,
@@ -935,14 +935,14 @@ impl<'a> fmt::Debug for ModuleData<'a> {
935935

936936
// Records a possibly-private value, type, or module definition.
937937
#[derive(Clone, Debug)]
938-
pub(crate) struct NameBinding<'a> {
938+
struct NameBinding<'a> {
939939
kind: NameBindingKind<'a>,
940940
expansion: Mark,
941941
span: Span,
942942
vis: ty::Visibility,
943943
}
944944

945-
pub(crate) trait ToNameBinding<'a> {
945+
trait ToNameBinding<'a> {
946946
fn to_name_binding(self, arenas: &'a ResolverArenas<'a>) -> &'a NameBinding<'a>;
947947
}
948948

0 commit comments

Comments
 (0)