From 5f11d19be568e322b9c67b518638ffad9264624f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 28 Nov 2023 16:30:57 +1100 Subject: [PATCH] Reduce `pub` exposure. --- compiler/rustc_session/src/config.rs | 2 +- compiler/rustc_session/src/parse.rs | 2 +- compiler/rustc_session/src/session.rs | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 8ad5a5199fe..d3ed5de9aa7 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -2294,7 +2294,7 @@ fn select_debuginfo(matches: &getopts::Matches, cg: &CodegenOptions) -> DebugInf if max_g > max_c { DebugInfo::Full } else { cg.debuginfo } } -pub(crate) fn parse_assert_incr_state( +fn parse_assert_incr_state( handler: &EarlyErrorHandler, opt_assertion: &Option, ) -> Option { diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 4d20d6d4187..f7b33cb598b 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -214,7 +214,7 @@ pub struct ParseSess { pub assume_incomplete_release: bool, /// Spans passed to `proc_macro::quote_span`. Each span has a numerical /// identifier represented by its position in the vector. - pub proc_macro_quoted_spans: AppendOnlyVec, + proc_macro_quoted_spans: AppendOnlyVec, /// Used to generate new `AttrId`s. Every `AttrId` is unique. pub attr_id_generator: AttrIdGenerator, } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 20a67d6d036..f8fa0e4dc50 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -10,8 +10,6 @@ use crate::parse::{add_feature_diagnostics, ParseSess}; use crate::search_paths::{PathKind, SearchPath}; use crate::{filesearch, lint}; -pub use rustc_ast::attr::MarkedAttrs; -pub use rustc_ast::Attribute; use rustc_data_structures::flock; use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_data_structures::jobserver::{self, Client}; @@ -48,7 +46,7 @@ use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::{atomic::AtomicBool, Arc}; -pub struct OptimizationFuel { +struct OptimizationFuel { /// If `-zfuel=crate=n` is specified, initially set to `n`, otherwise `0`. remaining: u64, /// We're rejecting all further optimizations. @@ -1682,7 +1680,7 @@ fn validate_commandline_args_with_session_available(sess: &Session) { /// Holds data on the current incremental compilation session, if there is one. #[derive(Debug)] -pub enum IncrCompSession { +enum IncrCompSession { /// This is the state the session will be in until the incr. comp. dir is /// needed. NotInitialized, @@ -1750,7 +1748,7 @@ impl EarlyErrorHandler { #[allow(rustc::untranslatable_diagnostic)] #[allow(rustc::diagnostic_outside_of_impl)] - pub(crate) fn early_struct_error( + pub fn early_struct_error( &self, msg: impl Into, ) -> DiagnosticBuilder<'_, !> {