2019-11-04 00:00:00 +00:00
|
|
|
// check-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2015-03-22 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2013-09-16 23:05:47 +10:00
|
|
|
/*
|
|
|
|
|
|
|
|
#7673 Polymorphically creating traits barely works
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-01-08 02:25:56 +01:00
|
|
|
#![feature(box_syntax)]
|
2014-05-05 18:56:44 -07:00
|
|
|
|
2013-09-25 00:43:37 -07:00
|
|
|
pub fn main() {}
|
2013-09-16 23:05:47 +10:00
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
trait A {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
|
|
|
|
2013-09-16 23:05:47 +10:00
|
|
|
impl<T: 'static> A for T {}
|
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
fn owned2<T: 'static>(a: Box<T>) { a as Box<dyn A>; }
|
|
|
|
fn owned3<T: 'static>(a: Box<T>) { box a as Box<dyn A>; }
|