]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-2935.rs
auto merge of #19648 : mquandalle/rust/patch-1, r=alexcrichton
[rust.git] / src / test / run-pass / issue-2935.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11
12 //type t = { a: int };
13 // type t = { a: bool };
14 type t = bool;
15
16 trait it {
17     fn f(&self);
18 }
19
20 impl it for t {
21     fn f(&self) { }
22 }
23
24 pub fn main() {
25   //    let x = ({a: 4i} as it);
26   //   let y = box ({a: 4i});
27   //    let z = box ({a: 4i} as it);
28   //    let z = box ({a: true} as it);
29     let z = box() (box true as Box<it>);
30     //  x.f();
31     // y.f();
32     // (*z).f();
33     println!("ok so far...");
34     z.f(); //segfault
35 }