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
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
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>; }
|
2022-07-07 04:36:10 +02:00
|
|
|
fn owned3<T: 'static>(a: Box<T>) { Box::new(a) as Box<dyn A>; }
|