Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:53:29+00:00 2026-06-07T09:53:29+00:00

The error obtained: $ rustc leakyFunction.rs –test $ ./leakyFunction running 1 test test testForLeakage

  • 0

The error obtained:

$ rustc leakyFunction.rs --test
$ ./leakyFunction 

running 1 test
test testForLeakage ... Unreclaimed object found at 0xb6d02d98: ((), (10))
leaked memory in rust main loop (1 objects)
leakyFunction: /home/havvy/rust/src/rt/memory_region.cpp:172:
    memory_region::~memory_region(): Assertion `false' failed.
Aborted (core dumped)

The rust code (reduced testcase):

use std;

type boxedFn = { theFn: fn () -> uint };

fn createClosure (closedUint: uint) -> boxedFn {
    { theFn: fn@ () -> uint { closedUint } }
}

#[test]
fn testForLeakage () {
    let aFn: boxedFn = createClosure(10);

    let myInt: uint = aFn.theFn();

    assert myInt == 10;
}

Why is this leaking memory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:53:32+00:00Added an answer on June 7, 2026 at 9:53 am

    Anytime you see a memory leak, it’s a bug in Rust (unless you are mucking about with native code…and in that case, our leak detectors probably wouldn’t find it). In this case, it’s issue #1896.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Error ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no
Error obtained is An error occurred, please try again later I created new facebook
there are 26 errors in this one sourceFile that I obtained from sourceForge. It
Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of
Error on link: ld: duplicate symbol _OBJC_METACLASS_$_Reachability in /Users/jmf/Documents/iOS Development/jmf_Client/jmf/jmf/ww_libs/libmfcbroem_ios.a(Reachability.o) and /Users/tpf/Library/Developer/Xcode/DerivedData/jmf-erlknghfcpoomnfanzovahfacgpv/Build/Intermediates/jmf.build/Debug-iphoneos/jmf.build/Objects-normal/armv7/Reachability.o for architecture
Error display as Incorrect syntax near '@Cmp_DocPath', if i use comment Line code I
Error I have a web app with a mass uploader (Plupload) for photos and
Error: undefined method `author' for nil:NilClass In my helper: def last_updated(group) g = group.last_updated_version
Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
Error code: Timeout Expired. The timeout period elapsed prior to completion of the operation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.