2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2014-06-11 22:01:48 +00:00
|
|
|
// #14399
|
|
|
|
// We'd previously ICE if we had a method call whose return
|
|
|
|
// value was coerced to a trait object. (v.clone() returns Box<B1>
|
|
|
|
// which is coerced to Box<A>).
|
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-01-08 01:25:56 +00:00
|
|
|
#![feature(box_syntax)]
|
|
|
|
|
2014-12-31 04:32:49 +00:00
|
|
|
#[derive(Clone)]
|
2014-06-11 22:01:48 +00:00
|
|
|
struct B1;
|
|
|
|
|
2015-02-18 23:58:07 +00:00
|
|
|
trait A { fn foo(&self) {} }
|
2014-06-11 22:01:48 +00:00
|
|
|
impl A for B1 {}
|
|
|
|
|
|
|
|
fn main() {
|
2015-02-17 20:41:32 +00:00
|
|
|
let v: Box<_> = box B1;
|
2014-06-11 22:01:48 +00:00
|
|
|
let _c: Box<A> = v.clone();
|
|
|
|
}
|