Rollup merge of #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 #117111.) `-C symbol-mangling-version` was stabilized back in rustc 1.59.0 (2022-02-24) via #90128, with the old unstable flag kept around (with a warning) as an alias to ease migration.
This commit is contained in:
commit
67b51879e3
12 changed files with 39 additions and 27 deletions
|
@ -817,7 +817,6 @@ fn test_unstable_options_tracking_hash() {
|
||||||
tracked!(split_lto_unit, Some(true));
|
tracked!(split_lto_unit, Some(true));
|
||||||
tracked!(src_hash_algorithm, Some(SourceFileHashAlgorithm::Sha1));
|
tracked!(src_hash_algorithm, Some(SourceFileHashAlgorithm::Sha1));
|
||||||
tracked!(stack_protector, StackProtector::All);
|
tracked!(stack_protector, StackProtector::All);
|
||||||
tracked!(symbol_mangling_version, Some(SymbolManglingVersion::V0));
|
|
||||||
tracked!(teach, true);
|
tracked!(teach, true);
|
||||||
tracked!(thinlto, Some(true));
|
tracked!(thinlto, Some(true));
|
||||||
tracked!(thir_unsafeck, true);
|
tracked!(thir_unsafeck, true);
|
||||||
|
|
|
@ -2674,28 +2674,19 @@ pub fn build_session_options(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle both `-Z symbol-mangling-version` and `-C symbol-mangling-version`; the latter takes
|
// Check for unstable values of `-C symbol-mangling-version`.
|
||||||
// precedence.
|
// This is what prevents them from being used on stable compilers.
|
||||||
match (cg.symbol_mangling_version, unstable_opts.symbol_mangling_version) {
|
match cg.symbol_mangling_version {
|
||||||
(Some(smv_c), Some(smv_z)) if smv_c != smv_z => {
|
// Stable values:
|
||||||
handler.early_error(
|
None | Some(SymbolManglingVersion::V0) => {}
|
||||||
"incompatible values passed for `-C symbol-mangling-version` \
|
// Unstable values:
|
||||||
and `-Z symbol-mangling-version`",
|
Some(SymbolManglingVersion::Legacy) => {
|
||||||
);
|
if !unstable_opts.unstable_options {
|
||||||
|
handler.early_error(
|
||||||
|
"`-C symbol-mangling-version=legacy` requires `-Z unstable-options`",
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(Some(SymbolManglingVersion::V0), _) => {}
|
|
||||||
(Some(_), _) if !unstable_opts.unstable_options => {
|
|
||||||
handler
|
|
||||||
.early_error("`-C symbol-mangling-version=legacy` requires `-Z unstable-options`");
|
|
||||||
}
|
|
||||||
(None, None) => {}
|
|
||||||
(None, smv) => {
|
|
||||||
handler.early_warn(
|
|
||||||
"`-Z symbol-mangling-version` is deprecated; use `-C symbol-mangling-version`",
|
|
||||||
);
|
|
||||||
cg.symbol_mangling_version = smv;
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for unstable values of `-C instrument-coverage`.
|
// Check for unstable values of `-C instrument-coverage`.
|
||||||
|
|
|
@ -1821,9 +1821,6 @@ written to standard error output)"),
|
||||||
"control if mem::uninitialized and mem::zeroed panic on more UB"),
|
"control if mem::uninitialized and mem::zeroed panic on more UB"),
|
||||||
strip: Strip = (Strip::None, parse_strip, [UNTRACKED],
|
strip: Strip = (Strip::None, parse_strip, [UNTRACKED],
|
||||||
"tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"),
|
"tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"),
|
||||||
symbol_mangling_version: Option<SymbolManglingVersion> = (None,
|
|
||||||
parse_symbol_mangling_version, [TRACKED],
|
|
||||||
"which mangling version to use for symbol names ('legacy' (default) or 'v0')"),
|
|
||||||
#[rustc_lint_opt_deny_field_access("use `Session::teach` instead of this field")]
|
#[rustc_lint_opt_deny_field_access("use `Session::teach` instead of this field")]
|
||||||
teach: bool = (false, parse_bool, [TRACKED],
|
teach: bool = (false, parse_bool, [TRACKED],
|
||||||
"show extended diagnostic help (default: no)"),
|
"show extended diagnostic help (default: no)"),
|
||||||
|
|
|
@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
|
||||||
const ENTRY_LIMIT: usize = 900;
|
const ENTRY_LIMIT: usize = 900;
|
||||||
// FIXME: The following limits should be reduced eventually.
|
// FIXME: The following limits should be reduced eventually.
|
||||||
const ISSUES_ENTRY_LIMIT: usize = 1854;
|
const ISSUES_ENTRY_LIMIT: usize = 1854;
|
||||||
const ROOT_ENTRY_LIMIT: usize = 866;
|
const ROOT_ENTRY_LIMIT: usize = 867;
|
||||||
|
|
||||||
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
|
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
|
||||||
"rs", // test source files
|
"rs", // test source files
|
||||||
|
|
|
@ -4,7 +4,7 @@ include ../tools.mk
|
||||||
# Ensure that crates compiled with different rustc versions cannot
|
# Ensure that crates compiled with different rustc versions cannot
|
||||||
# be dynamically linked.
|
# be dynamically linked.
|
||||||
|
|
||||||
FLAGS := -Cprefer-dynamic -Zsymbol-mangling-version=v0
|
FLAGS := -Cprefer-dynamic -Csymbol-mangling-version=v0
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
ifeq ($(UNAME),Linux)
|
ifeq ($(UNAME),Linux)
|
||||||
EXT=".so"
|
EXT=".so"
|
||||||
|
|
2
tests/ui/symbol-mangling-version/bad-value.bad.stderr
Normal file
2
tests/ui/symbol-mangling-version/bad-value.bad.stderr
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
error: incorrect value `bad-value` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected
|
||||||
|
|
2
tests/ui/symbol-mangling-version/bad-value.blank.stderr
Normal file
2
tests/ui/symbol-mangling-version/bad-value.blank.stderr
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
error: incorrect value `` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
error: codegen option `symbol-mangling-version` requires either `legacy` or `v0` (RFC 2603) (C symbol-mangling-version=<value>)
|
||||||
|
|
6
tests/ui/symbol-mangling-version/bad-value.rs
Normal file
6
tests/ui/symbol-mangling-version/bad-value.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// revisions: no-value blank bad
|
||||||
|
// [no-value] compile-flags: -Csymbol-mangling-version
|
||||||
|
// [blank] compile-flags: -Csymbol-mangling-version=
|
||||||
|
// [bad] compile-flags: -Csymbol-mangling-version=bad-value
|
||||||
|
|
||||||
|
fn main() {}
|
5
tests/ui/symbol-mangling-version/stable.rs
Normal file
5
tests/ui/symbol-mangling-version/stable.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// check-pass
|
||||||
|
// revisions: v0
|
||||||
|
// [v0] compile-flags: -Csymbol-mangling-version=v0
|
||||||
|
|
||||||
|
fn main() {}
|
2
tests/ui/symbol-mangling-version/unstable.legacy.stderr
Normal file
2
tests/ui/symbol-mangling-version/unstable.legacy.stderr
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
error: `-C symbol-mangling-version=legacy` requires `-Z unstable-options`
|
||||||
|
|
6
tests/ui/symbol-mangling-version/unstable.rs
Normal file
6
tests/ui/symbol-mangling-version/unstable.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// revisions: legacy legacy-ok
|
||||||
|
// [legacy] compile-flags: -Csymbol-mangling-version=legacy
|
||||||
|
// [legacy-ok] check-pass
|
||||||
|
// [legacy-ok] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue