Skip to content

Commit

Permalink
Update references to -Z symbol-mangling-version to use -C
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
joshtriplett committed Jan 1, 2022
1 parent bbf4b66 commit ff94b3b
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ options! {
instrument_coverage: Option<InstrumentCoverage> = (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`
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_symbol_mangling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/inline-hint.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/share-generics-dylib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lifetimes/issue-84604.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags: -Zsymbol-mangling-version=v0
// compile-flags: -Csymbol-mangling-version=v0

pub fn f<T: ?Sized>() {}
pub trait Frob<T: ?Sized> {}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/panics/issue-47429-short-backtraces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/polymorphization/closure_in_upvar/fn.rs
Original file line number Diff line number Diff line change
@@ -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 = |_: ()| ();
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/polymorphization/closure_in_upvar/fnmut.rs
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/polymorphization/closure_in_upvar/fnonce.rs
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/polymorphization/closure_in_upvar/other.rs
Original file line number Diff line number Diff line change
@@ -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 = |_: ()| ();
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/polymorphization/symbol-ambiguity.rs
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/basic.rs
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/symbol-names/const-generics-demangling.rs
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/symbol-names/const-generics-str-demangling.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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}).
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/const-generics.rs
Original file line number Diff line number Diff line change
@@ -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<const F: char>;
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/impl1.rs
Original file line number Diff line number Diff line change
@@ -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?\)" -> "<SYMBOL_HASH>)"

#![feature(auto_traits, rustc_attrs)]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/issue-60925.rs
Original file line number Diff line number Diff line change
@@ -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)]

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/issue-75326.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/issue-76365.rs
Original file line number Diff line number Diff line change
@@ -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<const F: bool>;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/symbol-names/trait-objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit ff94b3b

Please sign in to comment.