@@ -414,7 +414,7 @@ top_level_options!(
414414
415415 // The list of crates to consider public for
416416 // checking leaked private dependency types in public interfaces
417- extern_public: Vec <String > [ TRACKED ] ,
417+ extern_public: Option < Vec <String > > [ TRACKED ] ,
418418 }
419419) ;
420420
@@ -610,7 +610,7 @@ impl Default for Options {
610610 cli_forced_thinlto_off : false ,
611611 remap_path_prefix : Vec :: new ( ) ,
612612 edition : DEFAULT_EDITION ,
613- extern_public : vec ! [ ]
613+ extern_public : None
614614 }
615615 }
616616}
@@ -1917,21 +1917,7 @@ pub fn build_session_options_and_crate_config(
19171917 let crate_types = parse_crate_types_from_list ( unparsed_crate_types)
19181918 . unwrap_or_else ( |e| early_error ( error_format, & e[ ..] ) ) ;
19191919
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+
19351921 let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
19361922
19371923 let mut debugging_opts = build_debugging_options ( matches, error_format) ;
@@ -1950,6 +1936,24 @@ pub fn build_session_options_and_crate_config(
19501936 ) ;
19511937 }
19521938
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+
19531957 let mut output_types = BTreeMap :: new ( ) ;
19541958 if !debugging_opts. parse_only {
19551959 for list in matches. opt_strs ( "emit" ) {
@@ -2488,6 +2492,7 @@ mod dep_tracking {
24882492 impl_dep_tracking_hash_via_hash ! ( Option <usize >) ;
24892493 impl_dep_tracking_hash_via_hash ! ( Option <String >) ;
24902494 impl_dep_tracking_hash_via_hash ! ( Option <( String , u64 ) >) ;
2495+ impl_dep_tracking_hash_via_hash ! ( Option <Vec <String >>) ;
24912496 impl_dep_tracking_hash_via_hash ! ( Option <MergeFunctions >) ;
24922497 impl_dep_tracking_hash_via_hash ! ( Option <PanicStrategy >) ;
24932498 impl_dep_tracking_hash_via_hash ! ( Option <RelroLevel >) ;
0 commit comments