@@ -313,7 +313,7 @@ pub struct LocationDetail {
313
313
}
314
314
315
315
impl LocationDetail {
316
- pub fn all ( ) -> Self {
316
+ pub ( crate ) fn all ( ) -> Self {
317
317
Self { file : true , line : true , column : true }
318
318
}
319
319
}
@@ -549,7 +549,7 @@ impl OutputTypes {
549
549
OutputTypes ( BTreeMap :: from_iter ( entries. iter ( ) . map ( |& ( k, ref v) | ( k, v. clone ( ) ) ) ) )
550
550
}
551
551
552
- pub fn get ( & self , key : & OutputType ) -> Option < & Option < OutFileName > > {
552
+ pub ( crate ) fn get ( & self , key : & OutputType ) -> Option < & Option < OutFileName > > {
553
553
self . 0 . get ( key)
554
554
}
555
555
@@ -662,10 +662,6 @@ impl Externs {
662
662
pub fn iter ( & self ) -> BTreeMapIter < ' _ , String , ExternEntry > {
663
663
self . 0 . iter ( )
664
664
}
665
-
666
- pub fn len ( & self ) -> usize {
667
- self . 0 . len ( )
668
- }
669
665
}
670
666
671
667
impl ExternEntry {
@@ -854,13 +850,13 @@ impl OutFileName {
854
850
855
851
#[ derive( Clone , Hash , Debug , HashStable_Generic , Encodable , Decodable ) ]
856
852
pub struct OutputFilenames {
857
- pub out_directory : PathBuf ,
853
+ pub ( crate ) out_directory : PathBuf ,
858
854
/// Crate name. Never contains '-'.
859
855
crate_stem : String ,
860
856
/// Typically based on `.rs` input file name. Any '-' is preserved.
861
857
filestem : String ,
862
858
pub single_output_file : Option < OutFileName > ,
863
- pub temps_directory : Option < PathBuf > ,
859
+ temps_directory : Option < PathBuf > ,
864
860
pub outputs : OutputTypes ,
865
861
}
866
862
@@ -898,7 +894,7 @@ impl OutputFilenames {
898
894
899
895
/// Gets the output path where a compilation artifact of the given type
900
896
/// should be placed on disk.
901
- pub fn output_path ( & self , flavor : OutputType ) -> PathBuf {
897
+ fn output_path ( & self , flavor : OutputType ) -> PathBuf {
902
898
let extension = flavor. extension ( ) ;
903
899
match flavor {
904
900
OutputType :: Metadata => {
@@ -1092,7 +1088,7 @@ impl Options {
1092
1088
|| self . unstable_opts . query_dep_graph
1093
1089
}
1094
1090
1095
- pub fn file_path_mapping ( & self ) -> FilePathMapping {
1091
+ pub ( crate ) fn file_path_mapping ( & self ) -> FilePathMapping {
1096
1092
file_path_mapping ( self . remap_path_prefix . clone ( ) , & self . unstable_opts )
1097
1093
}
1098
1094
@@ -1173,14 +1169,14 @@ pub enum Passes {
1173
1169
}
1174
1170
1175
1171
impl Passes {
1176
- pub fn is_empty ( & self ) -> bool {
1172
+ fn is_empty ( & self ) -> bool {
1177
1173
match * self {
1178
1174
Passes :: Some ( ref v) => v. is_empty ( ) ,
1179
1175
Passes :: All => false ,
1180
1176
}
1181
1177
}
1182
1178
1183
- pub fn extend ( & mut self , passes : impl IntoIterator < Item = String > ) {
1179
+ pub ( crate ) fn extend ( & mut self , passes : impl IntoIterator < Item = String > ) {
1184
1180
match * self {
1185
1181
Passes :: Some ( ref mut v) => v. extend ( passes) ,
1186
1182
Passes :: All => { }
@@ -1206,7 +1202,7 @@ pub struct BranchProtection {
1206
1202
pub pac_ret : Option < PacRet > ,
1207
1203
}
1208
1204
1209
- pub const fn default_lib_output ( ) -> CrateType {
1205
+ pub ( crate ) const fn default_lib_output ( ) -> CrateType {
1210
1206
CrateType :: Rlib
1211
1207
}
1212
1208
@@ -1584,15 +1580,15 @@ pub fn build_target_config(
1584
1580
}
1585
1581
1586
1582
#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
1587
- pub enum OptionStability {
1583
+ enum OptionStability {
1588
1584
Stable ,
1589
1585
Unstable ,
1590
1586
}
1591
1587
1592
1588
pub struct RustcOptGroup {
1593
1589
pub apply : Box < dyn Fn ( & mut getopts:: Options ) -> & mut getopts:: Options > ,
1594
- pub name : & ' static str ,
1595
- pub stability : OptionStability ,
1590
+ name : & ' static str ,
1591
+ stability : OptionStability ,
1596
1592
}
1597
1593
1598
1594
impl RustcOptGroup {
@@ -1628,8 +1624,8 @@ mod opt {
1628
1624
1629
1625
use super :: RustcOptGroup ;
1630
1626
1631
- pub type R = RustcOptGroup ;
1632
- pub type S = & ' static str ;
1627
+ type R = RustcOptGroup ;
1628
+ type S = & ' static str ;
1633
1629
1634
1630
fn stable < F > ( name : S , f : F ) -> R
1635
1631
where
@@ -1649,32 +1645,34 @@ mod opt {
1649
1645
if a. len ( ) > b. len ( ) { a } else { b }
1650
1646
}
1651
1647
1652
- pub fn opt_s ( a : S , b : S , c : S , d : S ) -> R {
1648
+ pub ( crate ) fn opt_s ( a : S , b : S , c : S , d : S ) -> R {
1653
1649
stable ( longer ( a, b) , move |opts| opts. optopt ( a, b, c, d) )
1654
1650
}
1655
- pub fn multi_s ( a : S , b : S , c : S , d : S ) -> R {
1651
+ pub ( crate ) fn multi_s ( a : S , b : S , c : S , d : S ) -> R {
1656
1652
stable ( longer ( a, b) , move |opts| opts. optmulti ( a, b, c, d) )
1657
1653
}
1658
- pub fn flag_s ( a : S , b : S , c : S ) -> R {
1654
+ pub ( crate ) fn flag_s ( a : S , b : S , c : S ) -> R {
1659
1655
stable ( longer ( a, b) , move |opts| opts. optflag ( a, b, c) )
1660
1656
}
1661
- pub fn flagmulti_s ( a : S , b : S , c : S ) -> R {
1657
+ pub ( crate ) fn flagmulti_s ( a : S , b : S , c : S ) -> R {
1662
1658
stable ( longer ( a, b) , move |opts| opts. optflagmulti ( a, b, c) )
1663
1659
}
1664
1660
1665
- pub fn opt ( a : S , b : S , c : S , d : S ) -> R {
1661
+ fn opt ( a : S , b : S , c : S , d : S ) -> R {
1666
1662
unstable ( longer ( a, b) , move |opts| opts. optopt ( a, b, c, d) )
1667
1663
}
1668
- pub fn multi ( a : S , b : S , c : S , d : S ) -> R {
1664
+ pub ( crate ) fn multi ( a : S , b : S , c : S , d : S ) -> R {
1669
1665
unstable ( longer ( a, b) , move |opts| opts. optmulti ( a, b, c, d) )
1670
1666
}
1671
1667
}
1668
+
1672
1669
static EDITION_STRING : LazyLock < String > = LazyLock :: new ( || {
1673
1670
format ! (
1674
1671
"Specify which edition of the compiler to use when compiling code. \
1675
1672
The default is {DEFAULT_EDITION} and the latest stable edition is {LATEST_STABLE_EDITION}."
1676
1673
)
1677
1674
} ) ;
1675
+
1678
1676
/// Returns the "short" subset of the rustc command line options,
1679
1677
/// including metadata for each option, such as whether the option is
1680
1678
/// part of the stable long-term interface for rustc.
@@ -1864,9 +1862,9 @@ pub fn parse_color(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches) -> Col
1864
1862
/// Possible json config files
1865
1863
pub struct JsonConfig {
1866
1864
pub json_rendered : HumanReadableErrorType ,
1867
- pub json_artifact_notifications : bool ,
1865
+ json_artifact_notifications : bool ,
1868
1866
pub json_unused_externs : JsonUnusedExterns ,
1869
- pub json_future_incompat : bool ,
1867
+ json_future_incompat : bool ,
1870
1868
}
1871
1869
1872
1870
/// Report unused externs in event stream
@@ -2992,7 +2990,7 @@ pub mod nightly_options {
2992
2990
is_nightly_build ( matches. opt_str ( "crate-name" ) . as_deref ( ) )
2993
2991
}
2994
2992
2995
- pub fn is_nightly_build ( krate : Option < & str > ) -> bool {
2993
+ fn is_nightly_build ( krate : Option < & str > ) -> bool {
2996
2994
UnstableFeatures :: from_environment ( krate) . is_nightly_build ( )
2997
2995
}
2998
2996
@@ -3199,7 +3197,7 @@ pub(crate) mod dep_tracking {
3199
3197
use std:: num:: NonZero ;
3200
3198
use std:: path:: PathBuf ;
3201
3199
3202
- pub trait DepTrackingHash {
3200
+ pub ( crate ) trait DepTrackingHash {
3203
3201
fn hash (
3204
3202
& self ,
3205
3203
hasher : & mut DefaultHasher ,
0 commit comments