Skip to content

SIGTRAP in drop glue when slice literal initialization panics #30018

Closed
@sfackler

Description

@sfackler
struct Foo;

impl Drop for Foo {
    fn drop(&mut self) {}
}

fn foo() -> Foo {
    panic!();
}

fn main() {
    let _ = &[foo()];
}

Backtrace:

* thread #1: tid = 0x9916e, 0x0000000100000deb test`Foo::drop.2547::ha10a92966c711a1c + 43, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
  * frame #0: 0x0000000100000deb test`Foo::drop.2547::ha10a92966c711a1c + 43
    frame #1: 0x0000000100000da1 test`_$u5b$Foo$u3b$$u20$1$u5d$::drop.2545::h30bf5c7af770ce1a + 49
    frame #2: 0x0000000100000d6c test`main::h49ea8f6746b41e81Raa + 92
    frame #3: 0x0000000100006493 test`sys_common::unwind::try::try_fn::h8880715059644542985 + 35
    frame #4: 0x00000001000040a9 test`__rust_try + 9
    frame #5: 0x000000010000631c test`rt::lang_start::hf0f318bf9acb9103hUw + 540
    frame #6: 0x0000000100000e7a test`main + 42
    frame #7: 0x00007fff8e9185ad libdyld.dylib`start + 1

Metadata

Metadata

Assignees

Labels

I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions