Skip to content

Commit bbb3391

Browse files
authored
Unrolled build for rust-lang#117509
Rollup merge of rust-lang#117509 - Zalathar:zsymbol, r=petrochenkov Remove support for alias `-Z symbol-mangling-version` (This is very similar to the removal of `-Z instrument-coverage` in rust-lang#117111.) `-C symbol-mangling-version` was stabilized back in rustc 1.59.0 (2022-02-24) via rust-lang#90128, with the old unstable flag kept around (with a warning) as an alias to ease migration.
2 parents b800c30 + 76103a8 commit bbb3391

File tree

12 files changed

+39
-27
lines changed

12 files changed

+39
-27
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)"),

src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
1111
const ENTRY_LIMIT: usize = 900;
1212
// FIXME: The following limits should be reduced eventually.
1313
const ISSUES_ENTRY_LIMIT: usize = 1854;
14-
const ROOT_ENTRY_LIMIT: usize = 866;
14+
const ROOT_ENTRY_LIMIT: usize = 867;
1515

1616
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
1717
"rs", // test source files

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"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `bad-value` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: incorrect value `` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: codegen option `symbol-mangling-version` requires either `legacy` or `v0` (RFC 2603) (C symbol-mangling-version=<value>)
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// revisions: no-value blank bad
2+
// [no-value] compile-flags: -Csymbol-mangling-version
3+
// [blank] compile-flags: -Csymbol-mangling-version=
4+
// [bad] compile-flags: -Csymbol-mangling-version=bad-value
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// check-pass
2+
// revisions: v0
3+
// [v0] compile-flags: -Csymbol-mangling-version=v0
4+
5+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: `-C symbol-mangling-version=legacy` requires `-Z unstable-options`
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// revisions: legacy legacy-ok
2+
// [legacy] compile-flags: -Csymbol-mangling-version=legacy
3+
// [legacy-ok] check-pass
4+
// [legacy-ok] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy
5+
6+
fn main() {}

0 commit comments

Comments
 (0)