2012-12-11 01:32:48 +00:00
|
|
|
// 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.
|
|
|
|
|
2012-08-07 02:16:44 +00:00
|
|
|
//type t = { a: int };
|
|
|
|
// type t = { a: bool };
|
|
|
|
type t = bool;
|
|
|
|
|
|
|
|
trait it {
|
|
|
|
fn f();
|
|
|
|
}
|
|
|
|
|
2013-02-14 19:47:00 +00:00
|
|
|
impl it for t {
|
2012-08-07 02:16:44 +00:00
|
|
|
fn f() { }
|
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2012-08-07 02:16:44 +00:00
|
|
|
// let x = ({a: 4i} as it);
|
|
|
|
// let y = @({a: 4i});
|
|
|
|
// let z = @({a: 4i} as it);
|
|
|
|
// let z = @({a: true} as it);
|
2013-03-12 20:00:50 +00:00
|
|
|
let z = @(@true as @it);
|
2012-08-07 02:16:44 +00:00
|
|
|
// x.f();
|
|
|
|
// y.f();
|
|
|
|
// (*z).f();
|
2012-10-12 19:32:36 +00:00
|
|
|
error!("ok so far...");
|
2012-08-07 02:16:44 +00:00
|
|
|
z.f(); //segfault
|
|
|
|
}
|