Skip to content

Commit

Permalink
Add test for crash in unsafe destructor check
Browse files Browse the repository at this point in the history
  • Loading branch information
bgamari committed Jul 15, 2014
1 parent d2c38aa commit 446f937
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/compile-fail/unsafe-destructor-check-crash.rs
@@ -0,0 +1,23 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.



// Regression test for issue #15557

#![allow(dead_code)]
struct AReg1<'a>(&'a u32);

impl<'a> Drop for AReg1<'a> {
//~^ ERROR: cannot implement a destructor on a structure with type parameters
fn drop(&mut self) {}
}

fn main() {}

5 comments on commit 446f937

@bors
Copy link
Contributor

@bors bors commented on 446f937 Jul 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pnkfelix
at bgamari@446f937

@bors
Copy link
Contributor

@bors bors commented on 446f937 Jul 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging bgamari/rust/subst-bug = 446f937 into auto

@bors
Copy link
Contributor

@bors bors commented on 446f937 Jul 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bgamari/rust/subst-bug = 446f937 merged ok, testing candidate = c523d86

@bors
Copy link
Contributor

@bors bors commented on 446f937 Jul 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = c523d86

Please sign in to comment.