diff --git a/llvm/lib/Demangle/RustDemangle.cpp b/llvm/lib/Demangle/RustDemangle.cpp --- a/llvm/lib/Demangle/RustDemangle.cpp +++ b/llvm/lib/Demangle/RustDemangle.cpp @@ -421,14 +421,26 @@ // | "D" // dyn Trait + Send + 'a // | // backref void Demangler::demangleType() { - char C = look(); + size_t Start = Position; + + char C = consume(); BasicType Type; - if (parseBasicType(C, Type)) { - consume(); + if (parseBasicType(C, Type)) return printBasicType(Type); - } - demanglePath(InType::Yes); + switch (C) { + case 'A': + print("["); + demangleType(); + print("; "); + demangleConst(); + print("]"); + break; + default: + Position = Start; + demanglePath(InType::Yes); + break; + } } // = diff --git a/llvm/test/Demangle/rust.test b/llvm/test/Demangle/rust.test --- a/llvm/test/Demangle/rust.test +++ b/llvm/test/Demangle/rust.test @@ -155,6 +155,11 @@ CHECK: named::> _RIC5namedIC4NameEE +; Types + +CHECK: types::<[u8; 0]> + _RIC5typesAhj0_E + ; Integer constants. Test value demangling. CHECK: integer::<0>