Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing dtor leaks fields #8781

Closed
brson opened this issue Aug 27, 2013 · 1 comment
Closed

Failing dtor leaks fields #8781

brson opened this issue Aug 27, 2013 · 1 comment
Labels
A-codegen Area: Code generation

Comments

@brson
Copy link
Contributor

brson commented Aug 27, 2013

// error-pattern: fail                                                                                                                                                           
fn main() {
    struct S {
        box: ~int
    }

    impl Drop for S {
        fn drop(&self) { fail!() }
    }

    let s = S { box: ~0 };
}
task <unnamed> failed at 'explicit failure', /home/brian/dev/rust/src/test/run-fail/test.rs:8
==7954== 8 bytes in 1 blocks are definitely lost in loss record 1 of 1
==7954==    at 0x559E58B: malloc (jemalloc.c:906)
==7954==    by 0x4EE69C5: rt::global_heap::malloc_raw::_d4e11475f81475::_0$x2e8$x2dpre (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so)
==7954==    by 0x400B27: _rust_main (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/test/run-fail/test.stage1-x86_64-unknown-linux-gnu)
==7954==    by 0x4F687C9: rt::task::__extensions__::build_start_wrapper::anon::anon::expr_fn_29465 (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so)
==7954==    by 0x4F67339: rt::task::__extensions__::run::anon::expr_fn_29387 (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so)
==7954==    by 0x5590E0E: rust_try (rust_builtin.cpp:520)
==7954==    by 0x4F671D7: rt::task::__extensions__::meth_29385::try::_199ab8d6eb226980::_0$x2e8$x2dpre (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so)
==7954==    by 0x4F67098: rt::task::__extensions__::meth_29383::run::_199ab8d6eb226980::_0$x2e8$x2dpre (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so)
==7954==    by 0x4F684AA: rt::task::__extensions__::build_start_wrapper::anon::expr_fn_29449 (in /opt/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.8-pre.so)
==7954==

@thestinger
Copy link
Contributor

Fixed by #10219.

xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Added missing `### What it does`

Adds the missing line to ``[`cast-slice-different-sizes`]`` lint documentation
fixes rust-lang#8781

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

2 participants