@@ -414,7 +414,7 @@ top_level_options!(
414
414
415
415
// The list of crates to consider public for
416
416
// checking leaked private dependency types in public interfaces
417
- extern_public: Vec <String > [ TRACKED ] ,
417
+ extern_public: Option < Vec <String > > [ TRACKED ] ,
418
418
}
419
419
) ;
420
420
@@ -610,7 +610,7 @@ impl Default for Options {
610
610
cli_forced_thinlto_off : false ,
611
611
remap_path_prefix : Vec :: new ( ) ,
612
612
edition : DEFAULT_EDITION ,
613
- extern_public : vec ! [ ]
613
+ extern_public : None
614
614
}
615
615
}
616
616
}
@@ -1917,21 +1917,7 @@ pub fn build_session_options_and_crate_config(
1917
1917
let crate_types = parse_crate_types_from_list ( unparsed_crate_types)
1918
1918
. unwrap_or_else ( |e| early_error ( error_format, & e[ ..] ) ) ;
1919
1919
1920
- if matches. opt_present ( "extern-public" ) && !nightly_options:: is_nightly_build ( ) {
1921
- early_error (
1922
- ErrorOutputType :: default ( ) ,
1923
- "'--extern-public' is unstable and only \
1924
- available for nightly builds of rustc."
1925
- )
1926
- }
1927
-
1928
- let mut extern_public: Vec < String > = matches. opt_strs ( "extern-public" ) .
1929
- iter ( ) . cloned ( ) . collect ( ) ;
1930
-
1931
- // FIXME - come up with a better way of handling this
1932
- extern_public. push ( "core" . to_string ( ) ) ;
1933
- extern_public. push ( "std" . to_string ( ) ) ;
1934
-
1920
+
1935
1921
let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
1936
1922
1937
1923
let mut debugging_opts = build_debugging_options ( matches, error_format) ;
@@ -1950,6 +1936,24 @@ pub fn build_session_options_and_crate_config(
1950
1936
) ;
1951
1937
}
1952
1938
1939
+ if matches. opt_present ( "extern-public" ) && !debugging_opts. unstable_options {
1940
+ early_error (
1941
+ ErrorOutputType :: default ( ) ,
1942
+ "'--extern-public' is unstable and only \
1943
+ available for nightly builds of rustc."
1944
+ )
1945
+ }
1946
+
1947
+ let mut extern_public: Option < Vec < String > > = matches. opt_str ( "extern-public" ) .
1948
+ map ( |s| s. split ( ',' ) . map ( |c| ( * c) . to_string ( ) ) . collect ( ) ) ;
1949
+
1950
+ // FIXME - come up with a better way of handling this
1951
+ if let Some ( p) = extern_public. as_mut ( ) {
1952
+ p. push ( "core" . to_string ( ) ) ;
1953
+ p. push ( "std" . to_string ( ) ) ;
1954
+ }
1955
+
1956
+
1953
1957
let mut output_types = BTreeMap :: new ( ) ;
1954
1958
if !debugging_opts. parse_only {
1955
1959
for list in matches. opt_strs ( "emit" ) {
@@ -2488,6 +2492,7 @@ mod dep_tracking {
2488
2492
impl_dep_tracking_hash_via_hash ! ( Option <usize >) ;
2489
2493
impl_dep_tracking_hash_via_hash ! ( Option <String >) ;
2490
2494
impl_dep_tracking_hash_via_hash ! ( Option <( String , u64 ) >) ;
2495
+ impl_dep_tracking_hash_via_hash ! ( Option <Vec <String >>) ;
2491
2496
impl_dep_tracking_hash_via_hash ! ( Option <MergeFunctions >) ;
2492
2497
impl_dep_tracking_hash_via_hash ! ( Option <PanicStrategy >) ;
2493
2498
impl_dep_tracking_hash_via_hash ! ( Option <RelroLevel >) ;
0 commit comments