Skip to content

Commit 1174ea7

Browse files
committed
sess: default to v0 symbol mangling
Rust's current mangling scheme depends on compiler internals; loses information about generic parameters (and other things) which makes for a worse experience when using external tools that need to interact with Rust symbol names; is inconsistent; and can contain `.` characters which aren't universally supported. Therefore, Rust has defined its own symbol mangling scheme which is defined in terms of the Rust language, not the compiler implementation; encodes information about generic parameters in a reversible way; has a consistent definition; and generates symbols that only use the characters `A-Z`, `a-z`, `0-9`, and `_`. Support for the new Rust symbol mangling scheme has been added to upstream tools that will need to interact with Rust symbols (e.g. debuggers). This commit changes the default symbol mangling scheme from the legacy scheme to the new Rust mangling scheme. Signed-off-by: David Wood <[email protected]>
1 parent d76fe15 commit 1174ea7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ impl Options {
14131413
}
14141414

14151415
pub fn get_symbol_mangling_version(&self) -> SymbolManglingVersion {
1416-
self.cg.symbol_mangling_version.unwrap_or(SymbolManglingVersion::Legacy)
1416+
self.symbol_mangling_version.unwrap_or(SymbolManglingVersion::V0)
14171417
}
14181418
}
14191419

0 commit comments

Comments
 (0)