MCP #705: Provide the option -Csymbol-mangling-version=hashed -Z unstable-options to shorten symbol names by replacing them with a digest.
Enrich test cases
This commit is contained in:
@@ -347,6 +347,7 @@ impl SwitchWithOptPath {
|
||||
pub enum SymbolManglingVersion {
|
||||
Legacy,
|
||||
V0,
|
||||
Hashed,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Hash)]
|
||||
@@ -2692,6 +2693,7 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
|
||||
match cg.symbol_mangling_version {
|
||||
// Stable values:
|
||||
None | Some(SymbolManglingVersion::V0) => {}
|
||||
|
||||
// Unstable values:
|
||||
Some(SymbolManglingVersion::Legacy) => {
|
||||
if !unstable_opts.unstable_options {
|
||||
@@ -2700,6 +2702,13 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
|
||||
);
|
||||
}
|
||||
}
|
||||
Some(SymbolManglingVersion::Hashed) => {
|
||||
if !unstable_opts.unstable_options {
|
||||
early_dcx.early_fatal(
|
||||
"`-C symbol-mangling-version=hashed` requires `-Z unstable-options`",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for unstable values of `-C instrument-coverage`.
|
||||
@@ -2741,6 +2750,12 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
|
||||
);
|
||||
}
|
||||
Some(SymbolManglingVersion::V0) => {}
|
||||
Some(SymbolManglingVersion::Hashed) => {
|
||||
early_dcx.early_warn(
|
||||
"-C instrument-coverage requires symbol mangling version `v0`, \
|
||||
but `-C symbol-mangling-version=hashed` was specified",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user