diff --git a/text/2603-rust-symbol-name-mangling-v0.md b/text/2603-rust-symbol-name-mangling-v0.md index 6da9cfba09b..abed85138e1 100644 --- a/text/2603-rust-symbol-name-mangling-v0.md +++ b/text/2603-rust-symbol-name-mangling-v0.md @@ -625,12 +625,12 @@ Mangled names conform to the following grammar: // The specifies the encoding version. = "_R" [] [] - = "C" // crate root - | "M" // (inherent impl) - | "X" // (trait impl) - | "Y" // (trait definition) - | "N" // ...::ident (nested path) - | "I" {} "E" // ... (generic args) + = "C" // crate root + | "M" // (inherent impl) + | "X" // (trait impl) + | "Y" // (trait definition) + | "N" // ...::ident (nested path) + | "I" {} "E" // ... (generic args) | // Path to an impl (without the Self type or the trait). @@ -655,10 +655,10 @@ Mangled names conform to the following grammar: // A-Z are used for special namespaces (e.g. closures), which the demangler // can show in a special way (e.g. `NC...` as `...::{closure}`), or just // default to showing the uppercase character. - = "C" // closure - | "S" // shim - | // other special namespaces - | // internal namespaces + = "C" // closure + | "S" // shim + | // other special namespaces + | // internal namespaces = | @@ -675,6 +675,7 @@ Mangled names conform to the following grammar: // innermost lifetimes, e.g. in `for<'a, 'b> fn(for<'c> fn(...))`, // any s in ... (but not inside more binders) will observe // the indices 1, 2, and 3 refer to 'c, 'b, and 'a, respectively. +// The number of bound lifetimes is value of + 1. = "G" = @@ -715,22 +716,24 @@ Mangled names conform to the following grammar: // If the "U" is present then the function is `unsafe`. // The return type is always present, but demanglers can // choose to omit the ` -> ()` by special-casing "u". - := ["U"] ["K" ] {} "E" + = [] ["U"] ["K" ] {} "E" = "C" | - = {} "E" + = [] {} "E" = {} = "p" = - | "p" // placeholder (e.g. for polymorphic constants), shown as _: T + | "p" // placeholder, shown as _ | -// The encoding of a constant depends on its type, currently only -// unsigned integers (mainly usize, for arrays) are supported, and they -// use their value, in base 16 (0-9a-f), not their memory representation. - = {} "_" +// The encoding of a constant depends on its type. Integers use their value, +// in base 16 (0-9a-f), not their memory representation. Negative integer +// values are preceded with "n". The bool value false is encoded as `0_`, true +// value as `1_`. The char constants are encoded using their Unicode scalar +// value. + = ["n"] {} "_" // uses 0-9-a-z-A-Z as digits, i.e. 'a' is decimal 10 and // 'Z' is decimal 61. @@ -748,7 +751,7 @@ Mangled names conform to the following grammar: ### Namespace Tags Namespaces are identified by an implementation defined single character tag -(the `` production). Only closures (`C`) and shims (`S`) have a +(the `` production). Only closures (`C`) and shims (`S`) have a specific character assigned to them so that demanglers can reliable adjust their output accordingly. Other namespace tags have to be omitted or shown verbatim during demangling. @@ -1150,3 +1153,6 @@ pub static QUUX: u32 = { - Add a recommended resolution for open question around Punycode identifiers. - Add a recommended resolution for open question around encoding function parameter types. - Allow identifiers to start with a digit. +- Make `` optional in `` and `` productions. +- Extend `` to include `bool` values, `char` values, and negative integer values. +- Remove type from constant placeholders.