1
Fork 0
rust/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs

23 lines
343 B
Rust
Raw Normal View History

2018-10-02 13:14:19 +02:00
// compile-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
/*
#7673 Polymorphically creating traits barely works
*/
#![feature(box_syntax)]
pub fn main() {}
trait A {
fn dummy(&self) { }
}
impl<T: 'static> A for T {}
2014-06-14 11:03:34 -07:00
fn owned2<T: 'static>(a: Box<T>) { a as Box<A>; }
fn owned3<T: 'static>(a: Box<T>) { box a as Box<A>; }