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