Skip to content

Commit c26af36

Browse files
committed
add a test for the memory leak error
1 parent 7ff7ecc commit c26af36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/compile-fail/memleak.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//error-pattern: the evaluated program leaked memory
2+
3+
fn main() {
4+
std::mem::forget(Box::new(42));
5+
}

0 commit comments

Comments
 (0)