From d376e63384d7b0ad467bb0464eaf15f737f72666 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 5 Jun 2023 11:55:16 -0700 Subject: [PATCH] Add description of forwards-compatible behavior. --- src/doc/rustc/src/symbol-mangling/v0.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/doc/rustc/src/symbol-mangling/v0.md b/src/doc/rustc/src/symbol-mangling/v0.md index 50075e72963..13f7be315c9 100644 --- a/src/doc/rustc/src/symbol-mangling/v0.md +++ b/src/doc/rustc/src/symbol-mangling/v0.md @@ -25,6 +25,14 @@ There is no standardized demangled form of the symbols, though suggestions are provided for how to demangle a symbol. Implementers may choose to demangle in different ways. +## Extensions + +This format may be extended in the future to add new tags as Rust is extended with new language items. +To be forward compatible, demanglers should gracefully handle symbols that have encodings where it encounters a tag character not described in this document. +For example, they may fall back to displaying the mangled symbol. +The format may be extended anywhere there is a tag character, such as the [type] rule. +The meaning of existing tags and encodings will not be changed. + ## Grammar notation The format of an encoded symbol is illustrated as a context free grammar in an extended BNF-like syntax.