diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2023-11-02 17:34:05 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2023-11-02 18:41:33 +1100 |
| commit | 76103a8f6e838ca5bd9cf16b6236519c7c78e81d (patch) | |
| tree | 1409f825e15891b1ae0ebfbd1bc60584b9b673aa /compiler/rustc_session/src | |
| parent | a9e1e43b561aa1c3d5500b5b8b82c6e3ba05cc6c (diff) | |
| download | rust-76103a8f6e838ca5bd9cf16b6236519c7c78e81d.tar.gz rust-76103a8f6e838ca5bd9cf16b6236519c7c78e81d.zip | |
Remove support for alias `-Z symbol-mangling-version`
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/config.rs | 33 | ||||
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 3 |
2 files changed, 12 insertions, 24 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index a8ebab4ae33..715a7f9cb63 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -2674,28 +2674,19 @@ pub fn build_session_options( ); } - // Handle both `-Z symbol-mangling-version` and `-C symbol-mangling-version`; the latter takes - // precedence. - match (cg.symbol_mangling_version, unstable_opts.symbol_mangling_version) { - (Some(smv_c), Some(smv_z)) if smv_c != smv_z => { - handler.early_error( - "incompatible values passed for `-C symbol-mangling-version` \ - and `-Z symbol-mangling-version`", - ); - } - (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 symbol-mangling-version`. + // This is what prevents them from being used on stable compilers. + match cg.symbol_mangling_version { + // Stable values: + None | Some(SymbolManglingVersion::V0) => {} + // Unstable values: + Some(SymbolManglingVersion::Legacy) => { + if !unstable_opts.unstable_options { + handler.early_error( + "`-C symbol-mangling-version=legacy` requires `-Z unstable-options`", + ); + } } - _ => {} } // Check for unstable values of `-C instrument-coverage`. diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 30c8b9d6700..8669c37e35a 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1823,9 +1823,6 @@ written to standard error output)"), "control if mem::uninitialized and mem::zeroed panic on more UB"), strip: Strip = (Strip::None, parse_strip, [UNTRACKED], "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")] teach: bool = (false, parse_bool, [TRACKED], "show extended diagnostic help (default: no)"), |
