Skip to content

Commit b1f42c3

Browse files
committed
Add helper as_string for DefIds
1 parent e43a5c5 commit b1f42c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gcc/rust/util/rust-mapping-common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ struct DefId
5050
return ((uint64_t) this->crateNum << 32 | this->localDefId)
5151
< ((uint64_t) other.crateNum << 32 | other.localDefId);
5252
}
53+
54+
std::string as_string () const
55+
{
56+
std::string buf;
57+
buf += std::to_string (crateNum);
58+
buf += std::to_string (localDefId);
59+
return buf;
60+
}
5361
};
5462

5563
#define UNKNOWN_CREATENUM ((uint32_t) (0))

0 commit comments

Comments
 (0)