Skip to content

Instantly share code, notes, and snippets.

@flaper87
Created September 9, 2013 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flaper87/6497196 to your computer and use it in GitHub Desktop.
Save flaper87/6497196 to your computer and use it in GitHub Desktop.
phantom /tmp $ cat test
; ModuleID = 'test.rc'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%tydesc = type { i64, i64, void ({}*, i8*)*, void ({}*, i8*)*, void ({}*, i8*)*, void ({}*, i8*)*, i64, { i8*, i64 } }
%struct.Test = type { %"enum.std::option::Option<~str>[#1]" }
%"enum.std::option::Option<~str>[#1]" = type { { i64, i64, [0 x i8] }* }
%str_slice = type { i8*, i64 }
%struct.Test2 = type { i64 }
@_rust_crate_map_toplevel = global { i32, i8*, i64, [2 x i64] } { i32 1, i8* null, i64 ptrtoint ([1 x { i64, i64 }]* @_rust_mod_map to i64), [2 x i64] [i64 ptrtoint (i64* @_rust_crate_map_std_0.8-pre_6c65cf4b443341b1 to i64), i64 0] }
@_ZN7DEFAULT16_5efb248d66f221d4v0.0E = internal constant { { i8* } } zeroinitializer
@_ZN8DEFAULT217_8ffd53b057551f804v0.0E = internal constant { i64 } { i64 1 }
@str954 = internal constant [7 x i8] c"Called\00"
@_ZN4Test10tydesc_95516_5efb248d66f221dE = internal constant %tydesc { i64 8, i64 ptrtoint (i1** getelementptr ({ i1, i1* }* null, i64 0, i32 1) to i64), void ({}*, i8*)* null, void ({}*, i8*)* bitcast (void ({}*, %struct.Test*)* @_ZN4Test13glue_drop_95816_5efb248d66f221dE to void ({}*, i8*)*), void ({}*, i8*)* null, void ({}*, i8*)* null, i64 0, { i8*, i64 } { i8* getelementptr inbounds ([5 x i8]* @str957, i32 0, i32 0), i64 4 } }
@str957 = internal constant [5 x i8] c"Test\00"
@"_ZN34std..option..Option$LT$$UP$str$GT$10tydesc_96116_a59b082395ce18eE" = internal constant %tydesc { i64 8, i64 ptrtoint (i1** getelementptr ({ i1, i1* }* null, i64 0, i32 1) to i64), void ({}*, i8*)* null, void ({}*, i8*)* bitcast (void ({}*, %"enum.std::option::Option<~str>[#1]"*)* @"_ZN34std..option..Option$LT$$UP$str$GT$13glue_drop_96416_a59b082395ce18eE" to void ({}*, i8*)*), void ({}*, i8*)* null, void ({}*, i8*)* null, i64 0, { i8*, i64 } { i8* getelementptr inbounds ([26 x i8]* @str963, i32 0, i32 0), i64 25 } }
@str963 = internal constant [26 x i8] c"std::option::Option<~str>\00"
@"_ZN8_$UP$str10tydesc_96715_63ad928d9758cbE" = internal constant %tydesc { i64 8, i64 ptrtoint (i1** getelementptr ({ i1, i1* }* null, i64 0, i32 1) to i64), void ({}*, i8*)* null, void ({}*, i8*)* bitcast (void ({}*, { i64, i64, [0 x i8] }**)* @"_ZN8_$UP$str13glue_drop_97015_63ad928d9758cbE" to void ({}*, i8*)*), void ({}*, i8*)* bitcast (void ({}*, { i64, i64, [0 x i8] }**)* @"_ZN8_$UP$str13glue_free_97215_63ad928d9758cbE" to void ({}*, i8*)*), void ({}*, i8*)* null, i64 0, { i8*, i64 } { i8* getelementptr inbounds ([5 x i8]* @str969, i32 0, i32 0), i64 4 } }
@str969 = internal constant [5 x i8] c"~str\00"
@_rust_crate_map_std_0.8-pre_6c65cf4b443341b1 = external global i64
@_rust_mod_map = internal global [1 x { i64, i64 }] zeroinitializer
@rust_abi_version = constant i64 1
; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0
; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #0
; Function Attrs: nounwind
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0
; Function Attrs: nounwind
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #0
; Function Attrs: nounwind
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
; Function Attrs: nounwind
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #0
; Function Attrs: noreturn nounwind
declare void @llvm.trap() #1
; Function Attrs: nounwind readnone
declare i8* @llvm.frameaddress(i32) #2
; Function Attrs: nounwind readonly
declare float @llvm.powi.f32(float, i32) #3
; Function Attrs: nounwind readonly
declare double @llvm.powi.f64(double, i32) #3
; Function Attrs: nounwind readonly
declare float @llvm.pow.f32(float, float) #3
; Function Attrs: nounwind readonly
declare double @llvm.pow.f64(double, double) #3
; Function Attrs: nounwind readonly
declare float @llvm.sqrt.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.sqrt.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.sin.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.sin.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.cos.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.cos.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.exp.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.exp.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.exp2.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.exp2.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.log.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.log.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.log10.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.log10.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.log2.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.log2.f64(double) #3
; Function Attrs: nounwind readnone
declare float @llvm.fma.f32(float, float, float) #2
; Function Attrs: nounwind readnone
declare double @llvm.fma.f64(double, double, double) #2
; Function Attrs: nounwind readonly
declare float @llvm.fabs.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.fabs.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.floor.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.floor.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.ceil.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.ceil.f64(double) #3
; Function Attrs: nounwind readonly
declare float @llvm.trunc.f32(float) #3
; Function Attrs: nounwind readonly
declare double @llvm.trunc.f64(double) #3
; Function Attrs: nounwind readnone
declare i8 @llvm.ctpop.i8(i8) #2
; Function Attrs: nounwind readnone
declare i16 @llvm.ctpop.i16(i16) #2
; Function Attrs: nounwind readnone
declare i32 @llvm.ctpop.i32(i32) #2
; Function Attrs: nounwind readnone
declare i64 @llvm.ctpop.i64(i64) #2
; Function Attrs: nounwind readnone
declare i8 @llvm.ctlz.i8(i8, i1) #2
; Function Attrs: nounwind readnone
declare i16 @llvm.ctlz.i16(i16, i1) #2
; Function Attrs: nounwind readnone
declare i32 @llvm.ctlz.i32(i32, i1) #2
; Function Attrs: nounwind readnone
declare i64 @llvm.ctlz.i64(i64, i1) #2
; Function Attrs: nounwind readnone
declare i8 @llvm.cttz.i8(i8, i1) #2
; Function Attrs: nounwind readnone
declare i16 @llvm.cttz.i16(i16, i1) #2
; Function Attrs: nounwind readnone
declare i32 @llvm.cttz.i32(i32, i1) #2
; Function Attrs: nounwind readnone
declare i64 @llvm.cttz.i64(i64, i1) #2
; Function Attrs: nounwind readnone
declare i16 @llvm.bswap.i16(i16) #2
; Function Attrs: nounwind readnone
declare i32 @llvm.bswap.i32(i32) #2
; Function Attrs: nounwind readnone
declare i64 @llvm.bswap.i64(i64) #2
; Function Attrs: nounwind readnone
declare { i8, i1 } @llvm.sadd.with.overflow.i8(i8, i8) #2
; Function Attrs: nounwind readnone
declare { i16, i1 } @llvm.sadd.with.overflow.i16(i16, i16) #2
; Function Attrs: nounwind readnone
declare { i32, i1 } @llvm.sadd.with.overflow.i32(i32, i32) #2
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64) #2
; Function Attrs: nounwind readnone
declare { i8, i1 } @llvm.uadd.with.overflow.i8(i8, i8) #2
; Function Attrs: nounwind readnone
declare { i16, i1 } @llvm.uadd.with.overflow.i16(i16, i16) #2
; Function Attrs: nounwind readnone
declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32) #2
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #2
; Function Attrs: nounwind readnone
declare { i8, i1 } @llvm.ssub.with.overflow.i8(i8, i8) #2
; Function Attrs: nounwind readnone
declare { i16, i1 } @llvm.ssub.with.overflow.i16(i16, i16) #2
; Function Attrs: nounwind readnone
declare { i32, i1 } @llvm.ssub.with.overflow.i32(i32, i32) #2
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.ssub.with.overflow.i64(i64, i64) #2
; Function Attrs: nounwind readnone
declare { i8, i1 } @llvm.usub.with.overflow.i8(i8, i8) #2
; Function Attrs: nounwind readnone
declare { i16, i1 } @llvm.usub.with.overflow.i16(i16, i16) #2
; Function Attrs: nounwind readnone
declare { i32, i1 } @llvm.usub.with.overflow.i32(i32, i32) #2
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.usub.with.overflow.i64(i64, i64) #2
; Function Attrs: nounwind readnone
declare { i8, i1 } @llvm.smul.with.overflow.i8(i8, i8) #2
; Function Attrs: nounwind readnone
declare { i16, i1 } @llvm.smul.with.overflow.i16(i16, i16) #2
; Function Attrs: nounwind readnone
declare { i32, i1 } @llvm.smul.with.overflow.i32(i32, i32) #2
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.smul.with.overflow.i64(i64, i64) #2
; Function Attrs: nounwind readnone
declare { i8, i1 } @llvm.umul.with.overflow.i8(i8, i8) #2
; Function Attrs: nounwind readnone
declare { i16, i1 } @llvm.umul.with.overflow.i16(i16, i16) #2
; Function Attrs: nounwind readnone
declare { i32, i1 } @llvm.umul.with.overflow.i32(i32, i32) #2
; Function Attrs: nounwind readnone
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2
declare void @upcall_trace(i8*, i8*, i64)
; Function Attrs: nounwind
declare i32 @upcall_rust_personality() #0
; Function Attrs: nounwind
declare void @upcall_reset_stack_limit() #0
; Function Attrs: uwtable
define void @_ZN7testing17_80df38b2c88b5c924v0.0E({ i64, %tydesc*, i8*, i8*, i8 }*, %struct.Test*) #4 {
"function top level":
%2 = alloca %str_slice
%3 = alloca { i8*, i32 }
%4 = getelementptr inbounds %str_slice* %2, i32 0, i32 0
store i8* getelementptr inbounds ([7 x i8]* @str954, i32 0, i32 0), i8** %4
%5 = getelementptr inbounds %str_slice* %2, i32 0, i32 1
store i64 6, i64* %5
invoke void @"_ZN2io7println17_cbd0294d6bc48ab611v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }* undef, %str_slice* %2)
to label %"normal return" unwind label %unwind
"normal return": ; preds = %"function top level"
call void @_ZN4Test13glue_drop_95816_5efb248d66f221dE({}* null, %struct.Test* %1)
ret void
unwind: ; preds = %"function top level"
%6 = landingpad { i8*, i32 } personality i32 ()* @upcall_rust_personality
cleanup
call void @upcall_reset_stack_limit()
store { i8*, i32 } %6, { i8*, i32 }* %3
br label %cleanup
cleanup: ; preds = %unwind
call void @_ZN4Test13glue_drop_95816_5efb248d66f221dE({}* null, %struct.Test* %1)
%7 = load { i8*, i32 }* %3
resume { i8*, i32 } %7
}
declare void @"_ZN2io7println17_cbd0294d6bc48ab611v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }*, %str_slice*)
; Function Attrs: optsize
define internal void @_ZN4Test13glue_drop_95816_5efb248d66f221dE({}*, %struct.Test*) #5 {
"function top level":
%2 = getelementptr inbounds %struct.Test* %1, i32 0, i32 0
call void @"_ZN34std..option..Option$LT$$UP$str$GT$13glue_drop_96416_a59b082395ce18eE"({}* null, %"enum.std::option::Option<~str>[#1]"* %2)
ret void
}
; Function Attrs: optsize
define internal void @"_ZN34std..option..Option$LT$$UP$str$GT$13glue_drop_96416_a59b082395ce18eE"({}*, %"enum.std::option::Option<~str>[#1]"*) #5 {
"function top level":
%2 = getelementptr inbounds %"enum.std::option::Option<~str>[#1]"* %1, i32 0, i32 0
%3 = load { i64, i64, [0 x i8] }** %2
%4 = icmp ne { i64, i64, [0 x i8] }* %3, null
switch i1 %4, label %enum-iter-unr [
i1 false, label %enum-iter-variant-0
i1 true, label %enum-iter-variant-1
]
enum-iter-unr: ; preds = %"function top level"
unreachable
enum-iter-next: ; preds = %"_ZN8_$UP$str13glue_drop_97015_63ad928d9758cbE.exit", %enum-iter-variant-0
ret void
enum-iter-variant-0: ; preds = %"function top level"
br label %enum-iter-next
enum-iter-variant-1: ; preds = %"function top level"
%5 = getelementptr inbounds %"enum.std::option::Option<~str>[#1]"* %1, i32 0, i32 0
%6 = load { i64, i64, [0 x i8] }** %5
%7 = icmp ne { i64, i64, [0 x i8] }* %6, null
br i1 %7, label %cond.i.i, label %"_ZN8_$UP$str13glue_drop_97015_63ad928d9758cbE.exit"
cond.i.i: ; preds = %enum-iter-variant-1
%8 = bitcast { i64, i64, [0 x i8] }* %6 to i8*
call void @_ZN2rt11global_heap14exchange_free_16_4174f1728f4fc9b4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* undef, i8* %8)
br label %"_ZN8_$UP$str13glue_drop_97015_63ad928d9758cbE.exit"
"_ZN8_$UP$str13glue_drop_97015_63ad928d9758cbE.exit": ; preds = %enum-iter-variant-1, %cond.i.i
br label %enum-iter-next
}
; Function Attrs: alwaysinline
define internal void @"_ZN8_$UP$str13glue_drop_97015_63ad928d9758cbE"({}*, { i64, i64, [0 x i8] }**) #6 {
"function top level":
%2 = load { i64, i64, [0 x i8] }** %1
%3 = icmp ne { i64, i64, [0 x i8] }* %2, null
br i1 %3, label %cond.i, label %"_ZN8_$UP$str13glue_free_97215_63ad928d9758cbE.exit"
cond.i: ; preds = %"function top level"
%4 = bitcast { i64, i64, [0 x i8] }* %2 to i8*
call void @_ZN2rt11global_heap14exchange_free_16_4174f1728f4fc9b4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* undef, i8* %4)
br label %"_ZN8_$UP$str13glue_free_97215_63ad928d9758cbE.exit"
"_ZN8_$UP$str13glue_free_97215_63ad928d9758cbE.exit": ; preds = %"function top level", %cond.i
ret void
}
; Function Attrs: alwaysinline
define internal void @"_ZN8_$UP$str13glue_free_97215_63ad928d9758cbE"({}*, { i64, i64, [0 x i8] }**) #6 {
"function top level":
%2 = load { i64, i64, [0 x i8] }** %1
%3 = icmp ne { i64, i64, [0 x i8] }* %2, null
br i1 %3, label %cond, label %next
next: ; preds = %cond, %"function top level"
ret void
cond: ; preds = %"function top level"
%4 = bitcast { i64, i64, [0 x i8] }* %2 to i8*
call void @_ZN2rt11global_heap14exchange_free_16_4174f1728f4fc9b4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* undef, i8* %4)
br label %next
}
; Function Attrs: inlinehint uwtable
define internal void @_ZN2rt11global_heap14exchange_free_16_4174f1728f4fc9b4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }*, i8*) #7 {
"function top level":
%__arg = alloca i8*
store i8* %1, i8** %__arg
%2 = load i8** %__arg
call void @"_ZN2rt11global_heap13exchange_free17_bf6638d34c91b17811v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }* undef, i8* %2)
ret void
}
declare void @"_ZN2rt11global_heap13exchange_free17_bf6638d34c91b17811v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }*, i8*)
; Function Attrs: uwtable
define void @_ZN8testing216_4821acc7862e83c4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }*, %struct.Test2*) #4 {
"function top level":
%2 = alloca %str_slice
%3 = getelementptr inbounds %str_slice* %2, i32 0, i32 0
store i8* getelementptr inbounds ([7 x i8]* @str954, i32 0, i32 0), i8** %3
%4 = getelementptr inbounds %str_slice* %2, i32 0, i32 1
store i64 6, i64* %4
call void @"_ZN2io7println17_cbd0294d6bc48ab611v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }* undef, %str_slice* %2)
ret void
}
; Function Attrs: uwtable
define void @_ZN4main16_d7d397690bb61804v0.0E({ i64, %tydesc*, i8*, i8*, i8 }*) #4 {
"function top level":
%__self = alloca %struct.Test2
%__self1 = alloca %struct.Test
%1 = bitcast %struct.Test2* %__self to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast ({ i64 }* @_ZN8DEFAULT217_8ffd53b057551f804v0.0E to i8*), i64 8, i32 8, i1 false)
call void @_ZN8testing216_4821acc7862e83c4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Test2* %__self)
%2 = bitcast %struct.Test* %__self1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* bitcast ({ { i8* } }* @_ZN7DEFAULT16_5efb248d66f221d4v0.0E to i8*), i64 8, i32 8, i1 false)
call void @llvm.memset.p0i8.i64(i8* bitcast ({ { i8* } }* @_ZN7DEFAULT16_5efb248d66f221d4v0.0E to i8*), i8 0, i64 8, i32 8, i1 false)
call void @_ZN7testing17_80df38b2c88b5c924v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Test* %__self1)
ret void
}
define void @_rust_main({ i64, %tydesc*, i8*, i8*, i8 }*) {
"function top level":
call void @_ZN4main16_d7d397690bb61804v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* %0)
ret void
}
define i64 @main(i64, i8**) {
top:
%2 = call i64 @"_ZN8unstable4lang5start17_76d6c774aa357c7a11v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }* null, i8* bitcast (void ({ i64, %tydesc*, i8*, i8*, i8 }*)* @_rust_main to i8*), i64 %0, i8** %1, i8* bitcast ({ i32, i8*, i64, [2 x i64] }* @_rust_crate_map_toplevel to i8*))
ret i64 %2
}
declare i64 @"_ZN8unstable4lang5start17_76d6c774aa357c7a11v0.8$x2dpreE"({ i64, %tydesc*, i8*, i8*, i8 }*, i8*, i64, i8**, i8*)
attributes #0 = { nounwind }
attributes #1 = { noreturn nounwind }
attributes #2 = { nounwind readnone }
attributes #3 = { nounwind readonly }
attributes #4 = { uwtable }
attributes #5 = { optsize }
attributes #6 = { alwaysinline }
attributes #7 = { inlinehint uwtable }
phantom /tmp $ gdb test 139 ↵
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/test...(no debugging symbols found)...done.
(gdb) r
Starting program: /tmp/test
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
[New Thread 0x7ffff7fbd700 (LWP 12550)]
[New Thread 0x7ffff6204700 (LWP 12551)]
Called[New Thread 0x7ffff6103700 (LWP 12552)]
[New Thread 0x7ffff4fff700 (LWP 12553)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fbd700 (LWP 12550)]
0x00007ffff658d90e in memset () from /usr/lib64/libc.so.6
(gdb) backtrace
#0 0x00007ffff658d90e in memset () from /usr/lib64/libc.so.6
#1 0x0000000000400f02 in main::_d7d397690bb6180::v0.0 ()
#2 0x0000000000400f4e in _rust_main ()
#3 0x00007ffff779ade0 in rt::task::__extensions__::build_start_wrapper::anon::anon::expr_fn_27304 () from /tmp/../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so
#4 0x00007ffff77992d7 in rt::task::__extensions__::run::anon::expr_fn_27232 () from /tmp/../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so
#5 0x00007ffff7403754 in rust_try (f=<optimized out>, fptr=<optimized out>, env=<optimized out>) at /home/flaper87/workspace/personal/rust/src/rt/rust_builtin.cpp:523
#6 0x00007ffff779920c in rt::task::Unwinder::try::_199ab8d6eb226980Qdan::v0.8$x2dpre () from /tmp/../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so
#7 0x00007ffff7799081 in rt::task::Task::run::_199ab8d6eb226980xqam::v0.8$x2dpre () from /tmp/../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so
#8 0x00007ffff779a9cc in rt::task::__extensions__::build_start_wrapper::anon::expr_fn_27289 () from /tmp/../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so
#9 0x0000000000000000 in ?? ()
(gdb)
phantom /tmp $ cat test.rs 1 ↵
struct Test {
m: Option<~str>
}
static DEFAULT: Test = Test{m: None};
struct Test2 {
m: int
}
static DEFAULT2: Test2 = Test2{m: 1};
fn testing(a: Test) {
println("Called");
}
fn testing2(a: Test2) {
println("Called");
}
fn main() {
testing2(DEFAULT2);
testing(DEFAULT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment