From bbf4b6699e41dd5a7c6d9afe4bc8d6af50afc768 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 21 Oct 2021 14:02:59 +0200 Subject: [PATCH 1/2] Stabilize -Z symbol-mangling-version as -C symbol-mangling-version This allows selecting `v0` symbol-mangling without an unstable option. Selecting `legacy` still requires -Z unstable-options. Continue supporting -Z symbol-mangling-version for compatibility for now, but show a deprecation warning for it. --- compiler/rustc_interface/src/tests.rs | 1 + compiler/rustc_metadata/src/rmeta/encoder.rs | 2 +- compiler/rustc_session/src/config.rs | 46 +++++++++++++++----- compiler/rustc_session/src/options.rs | 3 ++ compiler/rustc_symbol_mangling/src/lib.rs | 2 +- 5 files changed, 42 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 4a181ce544de0..816e770f01252 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -594,6 +594,7 @@ fn test_codegen_options_tracking_hash() { tracked!(relocation_model, Some(RelocModel::Pic)); tracked!(soft_float, true); tracked!(split_debuginfo, Some(SplitDebuginfo::Packed)); + tracked!(symbol_mangling_version, Some(SymbolManglingVersion::V0)); tracked!(target_cpu, Some(String::from("abc"))); tracked!(target_feature, String::from("all the features, all of them")); } diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index e2aaa88f548f1..3942846e79df0 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -721,7 +721,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { no_builtins: tcx.sess.contains_name(&attrs, sym::no_builtins), panic_runtime: tcx.sess.contains_name(&attrs, sym::panic_runtime), profiler_runtime: tcx.sess.contains_name(&attrs, sym::profiler_runtime), - symbol_mangling_version: tcx.sess.opts.debugging_opts.get_symbol_mangling_version(), + symbol_mangling_version: tcx.sess.opts.get_symbol_mangling_version(), crate_deps, dylib_dependency_formats, diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 607ee8da975cc..f2c7959ddb6e3 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -781,6 +781,10 @@ impl Options { }, } } + + pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion { + self.cg.symbol_mangling_version.unwrap_or(SymbolManglingVersion::Legacy) + } } impl DebuggingOptions { @@ -794,10 +798,6 @@ impl DebuggingOptions { deduplicate_diagnostics: self.deduplicate_diagnostics, } } - - pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion { - self.symbol_mangling_version.unwrap_or(SymbolManglingVersion::Legacy) - } } // The type of entry function, so users can have their own entry functions @@ -2116,6 +2116,34 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { ); } + // Handle both `-Z symbol-mangling-version` and `-C symbol-mangling-version`; the latter takes + // precedence. + match (cg.symbol_mangling_version, debugging_opts.symbol_mangling_version) { + (Some(smv_c), Some(smv_z)) if smv_c != smv_z => { + early_error( + error_format, + "incompatible values passed for `-C symbol-mangling-version` \ + and `-Z symbol-mangling-version`", + ); + } + (Some(SymbolManglingVersion::V0), _) => {} + (Some(_), _) if !debugging_opts.unstable_options => { + early_error( + error_format, + "`-C symbol-mangling-version=legacy` requires `-Z unstable-options`", + ); + } + (None, None) => {} + (None, smv) => { + early_warn( + error_format, + "`-Z symbol-mangling-version` is deprecated; use `-C symbol-mangling-version`", + ); + cg.symbol_mangling_version = smv; + } + _ => {} + } + if debugging_opts.instrument_coverage.is_some() && debugging_opts.instrument_coverage != Some(InstrumentCoverage::Off) { @@ -2127,19 +2155,17 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { ); } - // `-Z instrument-coverage` implies `-Z symbol-mangling-version=v0` - to ensure consistent + // `-Z instrument-coverage` implies `-C symbol-mangling-version=v0` - to ensure consistent // and reversible name mangling. Note, LLVM coverage tools can analyze coverage over // multiple runs, including some changes to source code; so mangled names must be consistent // across compilations. - match debugging_opts.symbol_mangling_version { - None => { - debugging_opts.symbol_mangling_version = Some(SymbolManglingVersion::V0); - } + match cg.symbol_mangling_version { + None => cg.symbol_mangling_version = Some(SymbolManglingVersion::V0), Some(SymbolManglingVersion::Legacy) => { early_warn( error_format, "-Z instrument-coverage requires symbol mangling version `v0`, \ - but `-Z symbol-mangling-version=legacy` was specified", + but `-C symbol-mangling-version=legacy` was specified", ); } Some(SymbolManglingVersion::V0) => {} diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index f59b9b304ca6f..494bbf7af25f6 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1083,6 +1083,9 @@ options! { "how to handle split-debuginfo, a platform-specific option"), strip: Strip = (Strip::None, parse_strip, [UNTRACKED], "tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"), + symbol_mangling_version: Option = (None, + parse_symbol_mangling_version, [TRACKED], + "which mangling version to use for symbol names ('legacy' (default) or 'v0')"), target_cpu: Option = (None, parse_opt_string, [TRACKED], "select target processor (`rustc --print target-cpus` for details)"), target_feature: String = (String::new(), parse_target_feature, [TRACKED], diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 65b5852bc3983..702528c327767 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -245,7 +245,7 @@ fn compute_symbol_name<'tcx>( // 2. we favor `instantiating_crate` where possible (i.e. when `Some`) let mangling_version_crate = instantiating_crate.unwrap_or(def_id.krate); let mangling_version = if mangling_version_crate == LOCAL_CRATE { - tcx.sess.opts.debugging_opts.get_symbol_mangling_version() + tcx.sess.opts.get_symbol_mangling_version() } else { tcx.symbol_mangling_version(mangling_version_crate) }; From ff94b3b12b30d1a52d594cb48f80efa39a6029a6 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 21 Oct 2021 14:57:14 +0200 Subject: [PATCH 2/2] Update references to `-Z symbol-mangling-version` to use `-C` Replace `-Z symbol-mangling-version=v0` with `-C symbol-mangling-version=v0`. Replace `-Z symbol-mangling-version=legacy` with `-Z unstable-options -C symbol-mangling-version=legacy`. --- compiler/rustc_codegen_gcc/config.sh | 2 +- compiler/rustc_codegen_gcc/test.sh | 2 +- compiler/rustc_session/src/options.rs | 2 +- compiler/rustc_symbol_mangling/src/lib.rs | 2 +- .../unstable-book/src/compiler-flags/instrument-coverage.md | 2 +- src/test/codegen/inline-hint.rs | 2 +- src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile | 6 +++--- src/test/run-make-fulldeps/share-generics-dylib/Makefile | 2 +- src/test/ui/lifetimes/issue-84604.rs | 2 +- src/test/ui/panics/issue-47429-short-backtraces.rs | 4 ++-- src/test/ui/polymorphization/closure_in_upvar/fn.rs | 2 +- src/test/ui/polymorphization/closure_in_upvar/fnmut.rs | 2 +- src/test/ui/polymorphization/closure_in_upvar/fnonce.rs | 2 +- src/test/ui/polymorphization/closure_in_upvar/other.rs | 2 +- src/test/ui/polymorphization/symbol-ambiguity.rs | 2 +- src/test/ui/symbol-names/basic.rs | 4 ++-- src/test/ui/symbol-names/const-generics-demangling.rs | 2 +- src/test/ui/symbol-names/const-generics-str-demangling.rs | 2 +- .../ui/symbol-names/const-generics-structural-demangling.rs | 2 +- src/test/ui/symbol-names/const-generics.rs | 4 ++-- src/test/ui/symbol-names/impl1.rs | 4 ++-- src/test/ui/symbol-names/issue-60925.rs | 4 ++-- src/test/ui/symbol-names/issue-75326.rs | 4 ++-- src/test/ui/symbol-names/issue-76365.rs | 4 ++-- src/test/ui/symbol-names/trait-objects.rs | 2 +- 25 files changed, 34 insertions(+), 34 deletions(-) diff --git a/compiler/rustc_codegen_gcc/config.sh b/compiler/rustc_codegen_gcc/config.sh index 87df2f2102bcd..a932c1c8372b4 100644 --- a/compiler/rustc_codegen_gcc/config.sh +++ b/compiler/rustc_codegen_gcc/config.sh @@ -38,7 +38,7 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then fi fi -export RUSTFLAGS="$linker -Cpanic=abort -Zsymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot" +export RUSTFLAGS="$linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot" # FIXME(antoyo): remove once the atomic shim is gone if [[ `uname` == 'Darwin' ]]; then diff --git a/compiler/rustc_codegen_gcc/test.sh b/compiler/rustc_codegen_gcc/test.sh index 944d0ce516e0f..b9aeee7955047 100755 --- a/compiler/rustc_codegen_gcc/test.sh +++ b/compiler/rustc_codegen_gcc/test.sh @@ -183,7 +183,7 @@ EOF git checkout src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs rm src/test/ui/llvm-asm/llvm-asm-in-out-operand.rs || true # TODO(antoyo): Enable back this test if I ever implement the llvm_asm! macro. - RUSTC_ARGS="-Zpanic-abort-tests -Zsymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot -Cpanic=abort" + RUSTC_ARGS="-Zpanic-abort-tests -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot -Cpanic=abort" echo "[TEST] rustc test suite" COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/ui/ --rustc-args "$RUSTC_ARGS" diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 494bbf7af25f6..c8adc9f00a1b9 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1230,7 +1230,7 @@ options! { instrument_coverage: Option = (None, parse_instrument_coverage, [TRACKED], "instrument the generated code to support LLVM source-based code coverage \ reports (note, the compiler build config must include `profiler = true`); \ - implies `-Z symbol-mangling-version=v0`. Optional values are: + implies `-C symbol-mangling-version=v0`. Optional values are: `=all` (implicit value) `=except-unused-generics` `=except-unused-functions` diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 702528c327767..1f38240ee4146 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -237,7 +237,7 @@ fn compute_symbol_name<'tcx>( // Pick the crate responsible for the symbol mangling version, which has to: // 1. be stable for each instance, whether it's being defined or imported - // 2. obey each crate's own `-Z symbol-mangling-version`, as much as possible + // 2. obey each crate's own `-C symbol-mangling-version`, as much as possible // We solve these as follows: // 1. because symbol names depend on both `def_id` and `instantiating_crate`, // both their `CrateNum`s are stable for any given instance, so we can pick diff --git a/src/doc/unstable-book/src/compiler-flags/instrument-coverage.md b/src/doc/unstable-book/src/compiler-flags/instrument-coverage.md index f4d1ca0ec6911..39eb407269c11 100644 --- a/src/doc/unstable-book/src/compiler-flags/instrument-coverage.md +++ b/src/doc/unstable-book/src/compiler-flags/instrument-coverage.md @@ -27,7 +27,7 @@ When running a coverage-instrumented program, the counter values are written to [`llvm.instrprof.increment`]: https://llvm.org/docs/LangRef.html#llvm-instrprof-increment-intrinsic [llvm code coverage mapping format]: https://llvm.org/docs/CoverageMappingFormat.html -> **Note**: `-Z instrument-coverage` also automatically enables `-Z symbol-mangling-version=v0` (tracking issue [#60705]). The `v0` symbol mangler is strongly recommended, but be aware that this demangler is also experimental. The `v0` demangler can be overridden by explicitly adding `-Z symbol-mangling-version=legacy`. +> **Note**: `-Z instrument-coverage` also automatically enables `-C symbol-mangling-version=v0` (tracking issue [#60705]). The `v0` symbol mangler is strongly recommended, but be aware that this demangler is also experimental. The `v0` demangler can be overridden by explicitly adding `-Z unstable-options -C symbol-mangling-version=legacy`. [#60705]: https://github.com/rust-lang/rust/issues/60705 diff --git a/src/test/codegen/inline-hint.rs b/src/test/codegen/inline-hint.rs index a2571c2e532a7..ad41badf38169 100644 --- a/src/test/codegen/inline-hint.rs +++ b/src/test/codegen/inline-hint.rs @@ -1,7 +1,7 @@ // Checks that closures, constructors, and shims except // for a drop glue receive inline hint by default. // -// compile-flags: -Cno-prepopulate-passes -Zsymbol-mangling-version=v0 +// compile-flags: -Cno-prepopulate-passes -Csymbol-mangling-version=v0 #![crate_type = "lib"] pub fn f() { diff --git a/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile b/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile index 54526e8ef23b3..4a9b3d70933e4 100644 --- a/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile +++ b/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile @@ -8,8 +8,8 @@ # and will probably get removed once `legacy` is gone. all: - $(RUSTC) a.rs --cfg x -C prefer-dynamic -Z symbol-mangling-version=legacy - $(RUSTC) b.rs -C prefer-dynamic -Z symbol-mangling-version=legacy + $(RUSTC) a.rs --cfg x -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=legacy + $(RUSTC) b.rs -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=legacy $(call RUN,b) - $(RUSTC) a.rs --cfg y -C prefer-dynamic -Z symbol-mangling-version=legacy + $(RUSTC) a.rs --cfg y -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=legacy $(call FAIL,b) diff --git a/src/test/run-make-fulldeps/share-generics-dylib/Makefile b/src/test/run-make-fulldeps/share-generics-dylib/Makefile index c6b5efcb4cdd8..282cb2461f69a 100644 --- a/src/test/run-make-fulldeps/share-generics-dylib/Makefile +++ b/src/test/run-make-fulldeps/share-generics-dylib/Makefile @@ -11,7 +11,7 @@ -include ../../run-make-fulldeps/tools.mk -COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Zsymbol-mangling-version=v0 +COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0 all: $(RUSTC) instance_provider_a.rs $(COMMON_ARGS) --crate-type=rlib diff --git a/src/test/ui/lifetimes/issue-84604.rs b/src/test/ui/lifetimes/issue-84604.rs index df8368da0a09a..b315ef0519071 100644 --- a/src/test/ui/lifetimes/issue-84604.rs +++ b/src/test/ui/lifetimes/issue-84604.rs @@ -1,5 +1,5 @@ // run-pass -// compile-flags: -Zsymbol-mangling-version=v0 +// compile-flags: -Csymbol-mangling-version=v0 pub fn f() {} pub trait Frob {} diff --git a/src/test/ui/panics/issue-47429-short-backtraces.rs b/src/test/ui/panics/issue-47429-short-backtraces.rs index 35ecfc0b27158..c34e00bab7cdd 100644 --- a/src/test/ui/panics/issue-47429-short-backtraces.rs +++ b/src/test/ui/panics/issue-47429-short-backtraces.rs @@ -14,8 +14,8 @@ // NOTE(eddyb) output differs between symbol mangling schemes // revisions: legacy v0 -// [legacy] compile-flags: -Zsymbol-mangling-version=legacy -// [v0] compile-flags: -Zsymbol-mangling-version=v0 +// [legacy] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy +// [v0] compile-flags: -Csymbol-mangling-version=v0 fn main() { panic!() diff --git a/src/test/ui/polymorphization/closure_in_upvar/fn.rs b/src/test/ui/polymorphization/closure_in_upvar/fn.rs index b0b39dbd3df61..e1030858814e0 100644 --- a/src/test/ui/polymorphization/closure_in_upvar/fn.rs +++ b/src/test/ui/polymorphization/closure_in_upvar/fn.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags:-Zpolymorphize=on -Zsymbol-mangling-version=v0 +// compile-flags:-Zpolymorphize=on -Csymbol-mangling-version=v0 fn foo(f: impl Fn()) { let x = |_: ()| (); diff --git a/src/test/ui/polymorphization/closure_in_upvar/fnmut.rs b/src/test/ui/polymorphization/closure_in_upvar/fnmut.rs index ba75f6c5a1099..62164ff948508 100644 --- a/src/test/ui/polymorphization/closure_in_upvar/fnmut.rs +++ b/src/test/ui/polymorphization/closure_in_upvar/fnmut.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags:-Zpolymorphize=on -Zsymbol-mangling-version=v0 +// compile-flags:-Zpolymorphize=on -Csymbol-mangling-version=v0 fn foo(f: impl Fn()) { // Mutate an upvar from `x` so that it implements `FnMut`. diff --git a/src/test/ui/polymorphization/closure_in_upvar/fnonce.rs b/src/test/ui/polymorphization/closure_in_upvar/fnonce.rs index e9761ad0bcb20..7a364882fb8fd 100644 --- a/src/test/ui/polymorphization/closure_in_upvar/fnonce.rs +++ b/src/test/ui/polymorphization/closure_in_upvar/fnonce.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags:-Zpolymorphize=on -Zsymbol-mangling-version=v0 +// compile-flags:-Zpolymorphize=on -Csymbol-mangling-version=v0 fn foo(f: impl Fn()) { // Move a non-copy type into `x` so that it implements `FnOnce`. diff --git a/src/test/ui/polymorphization/closure_in_upvar/other.rs b/src/test/ui/polymorphization/closure_in_upvar/other.rs index 7614aa83fcd15..27d59ec889980 100644 --- a/src/test/ui/polymorphization/closure_in_upvar/other.rs +++ b/src/test/ui/polymorphization/closure_in_upvar/other.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags:-Zpolymorphize=on -Zsymbol-mangling-version=v0 +// compile-flags:-Zpolymorphize=on -Csymbol-mangling-version=v0 fn y_uses_f(f: impl Fn()) { let x = |_: ()| (); diff --git a/src/test/ui/polymorphization/symbol-ambiguity.rs b/src/test/ui/polymorphization/symbol-ambiguity.rs index d97bae183d9c2..6277a902fa213 100644 --- a/src/test/ui/polymorphization/symbol-ambiguity.rs +++ b/src/test/ui/polymorphization/symbol-ambiguity.rs @@ -1,5 +1,5 @@ // build-pass -// compile-flags: -Zpolymorphize=on -Zsymbol-mangling-version=v0 +// compile-flags: -Zpolymorphize=on -Csymbol-mangling-version=v0 pub(crate) struct Foo<'a, I, E>(I, &'a E); diff --git a/src/test/ui/symbol-names/basic.rs b/src/test/ui/symbol-names/basic.rs index a6fbe98e6ed41..65a63262810fe 100644 --- a/src/test/ui/symbol-names/basic.rs +++ b/src/test/ui/symbol-names/basic.rs @@ -1,7 +1,7 @@ // build-fail // revisions: legacy v0 -//[legacy]compile-flags: -Z symbol-mangling-version=legacy - //[v0]compile-flags: -Z symbol-mangling-version=v0 +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy + //[v0]compile-flags: -C symbol-mangling-version=v0 #![feature(rustc_attrs)] diff --git a/src/test/ui/symbol-names/const-generics-demangling.rs b/src/test/ui/symbol-names/const-generics-demangling.rs index d44c8f0abaec8..5c40c391a9e0b 100644 --- a/src/test/ui/symbol-names/const-generics-demangling.rs +++ b/src/test/ui/symbol-names/const-generics-demangling.rs @@ -1,5 +1,5 @@ // build-fail -// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c +// compile-flags: -C symbol-mangling-version=v0 --crate-name=c // normalize-stderr-test: "c\[.*?\]" -> "c[HASH]" #![feature(rustc_attrs)] diff --git a/src/test/ui/symbol-names/const-generics-str-demangling.rs b/src/test/ui/symbol-names/const-generics-str-demangling.rs index 300f6510380f4..619b34f2559a8 100644 --- a/src/test/ui/symbol-names/const-generics-str-demangling.rs +++ b/src/test/ui/symbol-names/const-generics-str-demangling.rs @@ -1,5 +1,5 @@ // build-fail -// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c +// compile-flags: -C symbol-mangling-version=v0 --crate-name=c // normalize-stderr-test: "c\[.*?\]" -> "c[HASH]" #![feature(adt_const_params, rustc_attrs)] #![allow(incomplete_features)] diff --git a/src/test/ui/symbol-names/const-generics-structural-demangling.rs b/src/test/ui/symbol-names/const-generics-structural-demangling.rs index 73de48fed6c60..df09ba494a74f 100644 --- a/src/test/ui/symbol-names/const-generics-structural-demangling.rs +++ b/src/test/ui/symbol-names/const-generics-structural-demangling.rs @@ -1,5 +1,5 @@ // build-fail -// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c +// compile-flags: -C symbol-mangling-version=v0 --crate-name=c // NOTE(eddyb) we need `core` for `core::option::Option`, normalize away its // disambiguator hash, which can/should change (including between stage{1,2}). diff --git a/src/test/ui/symbol-names/const-generics.rs b/src/test/ui/symbol-names/const-generics.rs index 2d136e6a99a83..1242126e0ccee 100644 --- a/src/test/ui/symbol-names/const-generics.rs +++ b/src/test/ui/symbol-names/const-generics.rs @@ -1,7 +1,7 @@ // check-pass // revisions: legacy v0 -//[legacy]compile-flags: -Z symbol-mangling-version=legacy --crate-type=lib -//[v0]compile-flags: -Z symbol-mangling-version=v0 --crate-type=lib +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy --crate-type=lib +//[v0]compile-flags: -C symbol-mangling-version=v0 --crate-type=lib // `char` pub struct Char; diff --git a/src/test/ui/symbol-names/impl1.rs b/src/test/ui/symbol-names/impl1.rs index f20cb1c01fd73..86f0a8b0bef4d 100644 --- a/src/test/ui/symbol-names/impl1.rs +++ b/src/test/ui/symbol-names/impl1.rs @@ -1,7 +1,7 @@ // build-fail // revisions: legacy v0 -//[legacy]compile-flags: -Z symbol-mangling-version=legacy - //[v0]compile-flags: -Z symbol-mangling-version=v0 +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy + //[v0]compile-flags: -C symbol-mangling-version=v0 //[legacy]normalize-stderr-test: "h[\w]{16}E?\)" -> ")" #![feature(auto_traits, rustc_attrs)] diff --git a/src/test/ui/symbol-names/issue-60925.rs b/src/test/ui/symbol-names/issue-60925.rs index 57114ca1f1582..ab0a3a7df1d15 100644 --- a/src/test/ui/symbol-names/issue-60925.rs +++ b/src/test/ui/symbol-names/issue-60925.rs @@ -1,7 +1,7 @@ // build-fail // revisions: legacy v0 -//[legacy]compile-flags: -Z symbol-mangling-version=legacy - //[v0]compile-flags: -Z symbol-mangling-version=v0 +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy + //[v0]compile-flags: -C symbol-mangling-version=v0 #![feature(rustc_attrs)] diff --git a/src/test/ui/symbol-names/issue-75326.rs b/src/test/ui/symbol-names/issue-75326.rs index d1bc152af5c60..4a1f5a21263dd 100644 --- a/src/test/ui/symbol-names/issue-75326.rs +++ b/src/test/ui/symbol-names/issue-75326.rs @@ -1,7 +1,7 @@ // build-fail // revisions: legacy v0 -//[legacy]compile-flags: -Z symbol-mangling-version=legacy -//[v0]compile-flags: -Z symbol-mangling-version=v0 +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy +//[v0]compile-flags: -C symbol-mangling-version=v0 //[legacy]normalize-stderr-test: "h[\w{16}]+" -> "SYMBOL_HASH" #![feature(rustc_attrs)] diff --git a/src/test/ui/symbol-names/issue-76365.rs b/src/test/ui/symbol-names/issue-76365.rs index c2e9f92f7b539..932057b659081 100644 --- a/src/test/ui/symbol-names/issue-76365.rs +++ b/src/test/ui/symbol-names/issue-76365.rs @@ -1,7 +1,7 @@ // check-pass // revisions: legacy v0 -//[legacy]compile-flags: -Z symbol-mangling-version=legacy --crate-type=lib -//[v0]compile-flags: -Z symbol-mangling-version=v0 --crate-type=lib +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy --crate-type=lib +//[v0]compile-flags: -C symbol-mangling-version=v0 --crate-type=lib pub struct Bar; diff --git a/src/test/ui/symbol-names/trait-objects.rs b/src/test/ui/symbol-names/trait-objects.rs index 502afebcb5ae8..5bcbc08413fe1 100644 --- a/src/test/ui/symbol-names/trait-objects.rs +++ b/src/test/ui/symbol-names/trait-objects.rs @@ -2,7 +2,7 @@ // build-fail // revisions: v0 -//[v0]compile-flags: -Z symbol-mangling-version=v0 +//[v0]compile-flags: -C symbol-mangling-version=v0 //[v0]normalize-stderr-test: "core\[.*?\]" -> "core[HASH]" #![feature(rustc_attrs)]