Skip to content

Commit 5829483

Browse files
committed
add a test for the memory leak error
1 parent 51f209a commit 5829483

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)