Skip to content

[MIR] double drop with slice patterns #34708

Description

@arielb1

Version

$ rustc -V
rustc 1.11.0-dev (42b7c32ac 2016-07-02)

STR

#![feature(slice_patterns, rustc_attrs)]

struct NoisyDrop;
impl Drop for NoisyDrop {
    fn drop(&mut self) { println!("splat!"); }
}

#[rustc_mir]
fn main() {
    let [x] = [NoisyDrop];
}

Expected Result

NoisyDrop gets dropped once

Actual Result

NoisyDrop is dropped twice

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-bugCategory: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions