Replace -Z default-hidden-visibility with -Z default-visibility · rust-lang/rust@f48194e (original) (raw)

`@@ -13,8 +13,8 @@ use rustc_span::edition::Edition;

`

13

13

`use rustc_span::{RealFileName, SourceFileHashAlgorithm};

`

14

14

`use rustc_target::spec::{

`

15

15

`CodeModel, FramePointer, LinkerFlavorCli, MergeFunctions, OnBrokenPipe, PanicStrategy,

`

16

``

`-

RelocModel, RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, TargetTriple, TlsModel,

`

17

``

`-

WasmCAbi,

`

``

16

`+

RelocModel, RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, SymbolVisibility,

`

``

17

`+

TargetTriple, TlsModel, WasmCAbi,

`

18

18

`};

`

19

19

``

20

20

`use crate::config::*;

`

`@@ -416,6 +416,8 @@ mod desc {

`

416

416

`` "one of: disabled, trampolines, or aliases";

``

417

417

`pub(crate) const parse_symbol_mangling_version: &str =

`

418

418

`` "one of: legacy, v0 (RFC 2603), or hashed";

``

``

419

`+

pub(crate) const parse_opt_symbol_visibility: &str =

`

``

420

`` +

"one of: hidden, protected, or interposable";

``

419

421

`` pub(crate) const parse_src_file_hash: &str = "either md5 or sha1";

``

420

422

`pub(crate) const parse_relocation_model: &str =

`

421

423

`` "one of supported relocation models (rustc --print relocation-models)";

``

`@@ -922,6 +924,20 @@ mod parse {

`

922

924

`true

`

923

925

`}

`

924

926

``

``

927

`+

pub(crate) fn parse_opt_symbol_visibility(

`

``

928

`+

slot: &mut Option,

`

``

929

`+

v: Option<&str>,

`

``

930

`+

) -> bool {

`

``

931

`+

if let Some(v) = v {

`

``

932

`+

if let Ok(vis) = SymbolVisibility::from_str(v) {

`

``

933

`+

*slot = Some(vis);

`

``

934

`+

} else {

`

``

935

`+

return false;

`

``

936

`+

}

`

``

937

`+

}

`

``

938

`+

true

`

``

939

`+

}

`

``

940

+

925

941

`pub(crate) fn parse_optimization_fuel(

`

926

942

`slot: &mut Option<(String, u64)>,

`

927

943

`v: Option<&str>,

`

`@@ -1688,8 +1704,8 @@ options! {

`

1688

1704

`"compress debug info sections (none, zlib, zstd, default: none)"),

`

1689

1705

` deduplicate_diagnostics: bool = (true, parse_bool, [UNTRACKED],

`

1690

1706

`"deduplicate identical diagnostics (default: yes)"),

`

1691

``

`-

default_hidden_visibility: Option = (None, parse_opt_bool, [TRACKED],

`

1692

``

`` -

"overrides the default_hidden_visibility setting of the target"),

``

``

1707

`+

default_visibility: Option = (None, parse_opt_symbol_visibility, [TRACKED],

`

``

1708

`` +

"overrides the default_visibility setting of the target"),

``

1693

1709

` dep_info_omit_d_target: bool = (false, parse_bool, [TRACKED],

`

1694

1710

`"in dep-info output, omit targets for tracking dependencies of the dep-info files \

`

1695

1711

` themselves (default: no)"),

`