We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 661a5ad commit 39ec9f8Copy full SHA for 39ec9f8
src/librustc_trans/trans/type_.rs
@@ -50,6 +50,12 @@ impl Type {
50
self.rf
51
}
52
53
+ pub fn to_string(self: Type) -> String {
54
+ llvm::build_string(|s| unsafe {
55
+ llvm::LLVMWriteTypeToString(self.to_ref(), s);
56
+ }).expect("non-UTF8 type description from LLVM")
57
+ }
58
+
59
pub fn void(ccx: &CrateContext) -> Type {
60
ty!(llvm::LLVMVoidTypeInContext(ccx.llcx()))
61
@@ -315,9 +321,7 @@ impl TypeNames {
315
321
316
322
317
323
pub fn type_to_string(&self, ty: Type) -> String {
318
- llvm::build_string(|s| unsafe {
319
- llvm::LLVMWriteTypeToString(ty.to_ref(), s);
320
- }).expect("non-UTF8 type description from LLVM")
324
+ ty.to_string()
325
326
327
pub fn types_to_str(&self, tys: &[Type]) -> String {
0 commit comments