Skip to content

generic function mishandles unique pointer #962

Closed
@jruderman

Description

@jruderman

(Based on test/run-pass/generic-drop-glue.rs)

fn f<T>(t: T) { let _t1 = t; }
fn main() { let x = ~1; f(x); }

Compiles to a program that double-frees (and leaks?):

g(10978,0xb0101000) malloc: *** error for object 0x1000000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rt: fatal, 'live_allocs < 1' failed, ../src/rt/memory_region.cpp:43 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions