diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-05-23 15:22:04 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-05-23 15:33:34 -0700 |
| commit | d213443a67c8dbef562ad207c62308e57c230511 (patch) | |
| tree | 1dfe5f9ae423b9c083f38aac302d774d4b2d69d3 /src/test | |
| parent | 6e2b082adc84c22ea3b023f4f08d7b21857fc399 (diff) | |
| download | rust-d213443a67c8dbef562ad207c62308e57c230511.tar.gz rust-d213443a67c8dbef562ad207c62308e57c230511.zip | |
rustc: Check for null before dropping ~objects. #5192
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/unique-object-move.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/run-pass/unique-object-move.rs b/src/test/run-pass/unique-object-move.rs new file mode 100644 index 00000000000..540de165213 --- /dev/null +++ b/src/test/run-pass/unique-object-move.rs @@ -0,0 +1,24 @@ +// Copyright 2012 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. + +// Issue #5192 + +pub trait EventLoop { } + +pub struct UvEventLoop { + uvio: int +} + +impl EventLoop for UvEventLoop { } + +pub fn main() { + let loop_: ~EventLoop = ~UvEventLoop { uvio: 0 } as ~EventLoop; + let loop2_ = loop_; +} \ No newline at end of file |
