Skip to content

Commit f933f7f

Browse files
committed
[Demangle][Rust] Parse trait definitions
Part of https://reviews.llvm.org/D102549
1 parent 9fa1380 commit f933f7f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

llvm/lib/Demangle/RustDemangle.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ void Demangler::demanglePath() {
162162
print(">");
163163
break;
164164
}
165+
case 'Y': {
166+
print("<");
167+
demangleType();
168+
print(" as ");
169+
demanglePath();
170+
print(">");
171+
break;
172+
}
165173
case 'N': {
166174
char NS = consume();
167175
if (!isLower(NS) && !isUpper(NS)) {

llvm/test/Demangle/rust.test

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ CHECK: <_ as Clone>
4949
CHECK: <_ as Clone>
5050
_RXs_C5cratepC5Clone
5151

52+
; Trait definition
53+
54+
CHECK: <_ as Ord>
55+
_RYpC3Ord
56+
5257
; Generic type arguments
5358

5459
CHECK: generic::<_>

0 commit comments

Comments
 (0)