Skip to content

Commit 76103a8

Browse files
committed
Remove support for alias -Z symbol-mangling-version
1 parent a9e1e43 commit 76103a8

File tree

4 files changed

+13
-26
lines changed

4 files changed

+13
-26
lines changed

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,6 @@ fn test_unstable_options_tracking_hash() {
817817
tracked!(split_lto_unit, Some(true));
818818
tracked!(src_hash_algorithm, Some(SourceFileHashAlgorithm::Sha1));
819819
tracked!(stack_protector, StackProtector::All);
820-
tracked!(symbol_mangling_version, Some(SymbolManglingVersion::V0));
821820
tracked!(teach, true);
822821
tracked!(thinlto, Some(true));
823822
tracked!(thir_unsafeck, true);

compiler/rustc_session/src/config.rs

+12-21
Original file line numberDiff line numberDiff line change
@@ -2674,28 +2674,19 @@ pub fn build_session_options(
26742674
);
26752675
}
26762676

2677-
// Handle both `-Z symbol-mangling-version` and `-C symbol-mangling-version`; the latter takes
2678-
// precedence.
2679-
match (cg.symbol_mangling_version, unstable_opts.symbol_mangling_version) {
2680-
(Some(smv_c), Some(smv_z)) if smv_c != smv_z => {
2681-
handler.early_error(
2682-
"incompatible values passed for `-C symbol-mangling-version` \
2683-
and `-Z symbol-mangling-version`",
2684-
);
2685-
}
2686-
(Some(SymbolManglingVersion::V0), _) => {}
2687-
(Some(_), _) if !unstable_opts.unstable_options => {
2688-
handler
2689-
.early_error("`-C symbol-mangling-version=legacy` requires `-Z unstable-options`");
2690-
}
2691-
(None, None) => {}
2692-
(None, smv) => {
2693-
handler.early_warn(
2694-
"`-Z symbol-mangling-version` is deprecated; use `-C symbol-mangling-version`",
2695-
);
2696-
cg.symbol_mangling_version = smv;
2677+
// Check for unstable values of `-C symbol-mangling-version`.
2678+
// This is what prevents them from being used on stable compilers.
2679+
match cg.symbol_mangling_version {
2680+
// Stable values:
2681+
None | Some(SymbolManglingVersion::V0) => {}
2682+
// Unstable values:
2683+
Some(SymbolManglingVersion::Legacy) => {
2684+
if !unstable_opts.unstable_options {
2685+
handler.early_error(
2686+
"`-C symbol-mangling-version=legacy` requires `-Z unstable-options`",
2687+
);
2688+
}
26972689
}
2698-
_ => {}
26992690
}
27002691

27012692
// Check for unstable values of `-C instrument-coverage`.

compiler/rustc_session/src/options.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1823,9 +1823,6 @@ written to standard error output)"),
18231823
"control if mem::uninitialized and mem::zeroed panic on more UB"),
18241824
strip: Strip = (Strip::None, parse_strip, [UNTRACKED],
18251825
"tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"),
1826-
symbol_mangling_version: Option<SymbolManglingVersion> = (None,
1827-
parse_symbol_mangling_version, [TRACKED],
1828-
"which mangling version to use for symbol names ('legacy' (default) or 'v0')"),
18291826
#[rustc_lint_opt_deny_field_access("use `Session::teach` instead of this field")]
18301827
teach: bool = (false, parse_bool, [TRACKED],
18311828
"show extended diagnostic help (default: no)"),

tests/run-make/crate-hash-rustc-version/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include ../tools.mk
44
# Ensure that crates compiled with different rustc versions cannot
55
# be dynamically linked.
66

7-
FLAGS := -Cprefer-dynamic -Zsymbol-mangling-version=v0
7+
FLAGS := -Cprefer-dynamic -Csymbol-mangling-version=v0
88
UNAME := $(shell uname)
99
ifeq ($(UNAME),Linux)
1010
EXT=".so"

0 commit comments

Comments
 (0)